Maven 3.3.1 ECLIPSE: -Dmaven.multiModuleProjectDirectory system not defined

I just installed Maven 3.3.1 on Mac OS X, and creating a Maven project with Eclipse gives me this error:

-Dmaven.multiModuleProjectDirectory system property is not set. Check $M2_HOME environment variable and mvn script match. 

This has not happened before with Maven 3.2.5.

Is there any way to fix this (other than downgrading to 3.2.5)?

Where exactly can I set this multiModuleProjectDirectory property in Eclipse?

+80
java eclipse maven macos
Mar 29 '15 at 14:50
source share
9 answers

In Eclipse you need to go like this.

 Window-> Preference -> Java -> Installed JREs -> Edit 

In the Default VM arguments edition you need to put

If you have already installed maven home.

 -Dmaven.multiModuleProjectDirectory=$M2_HOME 
+169
Mar 31 '15 at 12:52
source share

This was reported as a bug with m2e in Eclipse at https://bugs.eclipse.org/bugs/show_bug.cgi?id=462944 due to changes in Maven 3.3.1.

This is fixed in m2e 1.5.2 as of 2015-04-13. This is an affordable release that can be installed from http://download.eclipse.org/technology/m2e/releases/ .

(You no longer need to change the JVM arguments for the entire workspace or for specific startup configurations.)

+17
Apr 19 '15 at 20:38
source share

In IntelliJ, you can set this parameter in the "VM Parameters" field, which you can find in the following configuration window:

Preferences / Assembly, Execution, Deployment / Assembly Tools / Maven / Runner

enter image description here

+17
Aug 13 '15 at 16:42
source share

Define this in the JVM parameters:

 -Dmaven.multiModuleProjectDirectory=HOME_PATH_OF_YOU_PROJECT 
+6
Mar 29 '15 at 15:40
source share

go to the launch configuration, create a new maven build launch configuration, where on the first tab you fill in the base directory and target, then go to the jre tab and add this configuration to vm args :

 -Dmaven.multiModuleProjectDirectory=%M2_HOME% 

where M2_HOME is an environment variable pointing to the base directory of your maven installation

+2
Apr 16 '15 at 18:19
source share

If you want to try the second method, you can try to download the path from http://download.eclipse.org/technology/m2e/milestones/1.5/ .

Open Help> install new software and download from the URL above. This way solved my problem.

+2
Jun 09 '15 at 7:05
source share

I ran into the same problem with Maven versions 3.3 and 3.2, so I decided to abandon it before version 3.0.5, and it did a great job.

+2
Aug 19 '15 at 9:59
source share

If you have this error message on your command line, check if your PATH variable points to the same maven installation folder as your M2_HOME. In my case, I mixed the two versions that led to this error.

+1
Sep 22 '16 at 7:42 on
source share

I had the same problem with intelliJ 14, I tried various solutions presented on the forums, but not developed. What I did was completely remove intellij and install intellij 15.0.1 and import the same project, then everything works fine.

0
Jan 06 '16 at 12:52
source share



All Articles