`

IntelliJ IDEA and Maven: M2_HOME trouble

 
阅读更多

IntelliJ IDEA and Maven: M2_HOME trouble

转自:http://richardlog.com/post/12118330250/intellij-idea-and-maven-m2-home-trouble

There’s an annoying issue when using Maven from IntelliJ IDEA on OSX. You might encounter the following error when building a Maven project.

No valid Maven installation found. Either set the home directory in the configuration dialog or set the M2_HOME environment variable on your system.

The issue is well known and there are various solutions to the problem. The trouble with some is they apply to old versions of OSX, specifically Leopard. If your running Snow Leopard or higher you don’t need to alter your launchd configuration. The following will suffice:

 

1) Check you Maven home directory.

2) Create the following file in ~/.MacOSX/environment.plist.

{
"M2_HOME"="/usr/share/maven";
M2="/usr/share/maven/bin";
}

3) Make sure you enter the correct path as shown in the Maven version info.

4) Reboot your system (I know it’s annoying).

Now you should have no problem starting Maven builds from IDEA.

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics