2

A Java and Maven noob here:

Using OSX 10.8

And Installed Maven with HomeBrew

1- If I say which mvn I will get this: /usr/local/bin/mvn

2- If I say echo $MAVEN_HOME I will get nothing back.

3- If I go to my Maven Installation on EClipse it will look like this:

enter image description here

4- If I go to Maven settings in IntelliJ, it will look like this: So far I have been able to run Maven goals with IntelliJ.

enter image description here

Ok That's all I have. Can you please take a look and see what are the inconsistencies I am having and what things to fix to set this correctly everywhere?

4

1 回答 1

1

在 Mac OS X 下,您应该在/etc/launchd.conf. launchd 加载的变量在您的 shell 以及 Intellij IDEA 等 GUI 应用程序中都可用。

Intellij IDEA 将使用 M2_HOME 来查找 Maven 安装。编辑或创建/etc/launchd.conf

setenv M2_HOME /usr/share/maven

不幸的是,要看到效果,您必须重新启动机器。另一个缺点是,您不能在文件中使用空格。这意味着,您不能将 MAVEN_OPTS 设置为多个 value

于 2013-04-03T07:17:26.513 回答