2

I'm trying to build something with maven, but keep getting the following error in intellij

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

So after searching the internet I found some ideas with the environment variables. But I checked with mvn -version and this is the response I get:

    Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T17:41:47+01:00)
    Maven home: /usr/local/Cellar/maven/3.3.9/libexec
    Java version: 1.8.0_65, vendor: Oracle Corporation
    Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre
    Default locale: nl_NL, platform encoding: UTF-8
OS name: "mac os x", version: "10.11", arch: "x86_64", family: "mac"

So I don't really know what I need to do extra to get this started?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Steve
  • 33
  • 2
  • 1
    Try pointing IDEA to your local Maven installation. Hit `Ctrl+Alt+S` to bring up the settings, then search for `Maven` and then set the Maven home directory. – manish Nov 23 '15 at 17:25
  • Possible duplicate of [-Dmaven.multiModuleProjectDirectory system propery is not set. Check $M2\_HOME environment variable and mvn script match](http://stackoverflow.com/questions/29153115/dmaven-multimoduleprojectdirectory-system-propery-is-not-set-check-m2-home-en) – talex Nov 23 '15 at 17:38

1 Answers1

4

If you are using IntelliJ, try to look at this post

You need to set the argument -Dmaven.multiModuleProjectDirectory=$M2_HOME to your JRE

Community
  • 1
  • 1
Olivier Boissé
  • 15,834
  • 6
  • 38
  • 56
  • pointing `$M2_HOME` to `jre` is bad idea. maven download dependency there. and `jre` folder most probably is readonly – talex Nov 23 '15 at 17:36
  • I didn't say pointing $M2_HOME to the jre, I just said to add an argument (-Dmaven.multiModuleProjectDirectory=$M2_HOME) in the JRE settings of intellij – Olivier Boissé Nov 23 '15 at 21:38