-1

When I try to build a maven project on eclipse, I get this error:

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

SwiftArchitect
  • 47,376
  • 28
  • 140
  • 179
  • People at SO aren't guru's. Unfortunately there are many things that can cause that error, yet you have given us nothing. Believe or not, but you actually no more about this error than we do right now. – AustinWBryan Feb 14 '16 at 04:27
  • http://stackoverflow.com/questions/29983683/dmaven-multimoduleprojectdirectory-not-set-issue-with-maven-and-intellij – Bob Feb 14 '16 at 04:31

2 Answers2

1

Set MAVEN_OPTS = -Dmaven.multiModuleProjectDirectory

Bob
  • 780
  • 9
  • 10
0

If you are developing application on Eclipse RCP and trying to build any project using any procedure (e.g. embedded maven -- by creating your own launch configuration file), then you will have to set "MavenLaunchConstants.ATTR_POM_DIR" attribute, provided the value of project path.

Code for reference :
ILaunchConfigurationWorkingCopy workingCopy = launchConfigurationType.newInstance(launchFileFolder, launchFileName); workingCopy.setAttribute(MavenLaunchConstants.ATTR_POM_DIR, <project_path>);