Maven 和 IntelliJ 的 '-Dmaven.multiModuleProjectDirectory Not set' 问题
2022-09-01 19:52:18
我花了相当多的时间试图弄清楚我做错了什么,并希望有人能够提供帮助。
我目前的设置是运行Maven 3.3.3(通过自制)和Java 1.8。IntelliJ 13 是首选的 IDE。
运行结果如下:mvn -version
Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-
22T12:57:37+01:00)
Maven home: /usr/local/Cellar/maven/3.3.3/libexec
Java version: 1.8.0_45, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.10.2", arch: "x86_64", family: "mac"
我相信这意味着一切都很好,但是当我去我的IDE并尝试运行Maven项目时,我得到这个错误:
/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/bin/java -Dmaven.home=/usr/local/Cellar/maven/3.3.3/libexec -Dclassworlds.conf=/usr/local/Cellar/maven/3.3.3/libexec/bin/m2.conf -Didea.launcher.port=7539 "-Didea.launcher.bin.path=/Applications/IntelliJ IDEA 13.app/bin" -Dfile.encoding=UTF-8 -classpath "/usr/local/Cellar/maven/3.3.3/libexec/boot/plexus-classworlds-2.5.2.jar:/Applications/IntelliJ IDEA 13.app/lib/idea_rt.jar" com.intellij.rt.execution.application.AppMain org.codehaus.classworlds.Launcher -Didea.version=13.1.3
-Dmaven.multiModuleProjectDirectory system propery is not set. Check $M2_HOME environment variable and mvn script match.
Process finished with exit code 1
我的M2_HOME var 设置为 ,与 homebrew 安装它的同一目录相同,这也与 IDE 设置匹配。/usr/local/Cellar/maven/3.3.3/libexec
一次搜索使我相信这可能与Maven版本和IDE有关,但我不相信。有人可以请对此有所了解吗?