IntelliJ Idea 14中的Maven 3.3.1配置错误 [英] Maven 3.3.1 Config Error in IntelliJ Idea 14
问题描述
我从 http://maven.apache.org/download.cgi 获得了maven .tar文件,并且将它安装到路径/ usr / local /。我在新窗口中运行mvn -version命令,输出正确。下面是我的主目录中的.bash_profile:
I got the maven .tar file from http://maven.apache.org/download.cgi, and installed it to the path /usr/local/. I run the mvn -version command in the new window, the output is correct. Below is my .bash_profile in my home directory:
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk7/Contents/Home
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
PATH=$JAVA_HOME/bin:$PATH:
export JAVA_HOME
export CLASSPATH
export PATH
M2_HOME=/usr/local/maven
M2=$M2_HOME/bin
PATH=$M2:$PATH
export M2_HOME
export M2
export PATH
且mvn -version低于:
and the mvn -version is below :
BianFranks-MacBook-Pro:~ Frank$ mvn -version
Apache Maven 3.3.1 (cab6659f9874fa96462afef40fcf6bc033d58c1c; 2015-03- 14T04:10:27+08:00)
Maven home: /usr/local/maven
Java version: 1.7.0_72, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk7/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"
但是在Intellij IDEA 14中通过Maven清理模块时提示:
But the tips occurred when cleaning the module via Maven in Intellij IDEA 14:
/Library/Java/JavaVirtualMachines/jdk7/Contents/Home/bin/java -Dmaven.home=/usr/local/maven -Dclassworlds.conf=/usr/local/maven/bin/m2.conf -Didea.launcher.port=7532 "-Didea.launcher.bin.path=/Applications/IntelliJ IDEA 14.app/Contents/bin" -Dfile.encoding=UTF-8 -classpath "/usr/local/maven/boot/plexus-classworlds-2.5.2.jar:/Applications/IntelliJ IDEA 14.app/Contents/lib/idea_rt.jar" com.intellij.rt.execution.application.AppMain org.codehaus.classworlds.Launcher -Didea.version=14.0.2 clean
-Dmaven.multiModuleProjectDirectory system propery is not set. Check $M2_HOME environment variable and mvn script match.
Process finished with exit code 1
系统属性未设置,但我不知道知道如何设置...
the system property is not set, but I don't know how to set it...
推荐答案
打开IntelliJ设置对话框。
Open up the IntelliJ settings dialog.
在Maven中 - > Runner选项设置以下VM选项:
-Dmaven.multiModuleProjectDirectory = project root
In Maven-->Runner options set a following VM option: -Dmaven.multiModuleProjectDirectory=project root
这篇关于IntelliJ Idea 14中的Maven 3.3.1配置错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!