Maven正在尝试使用/var/empty/.m2/repository作为我的本地存储库

Maven正在尝试使用/var/empty/.m2/repository作为我的本地存储库,maven,maven-3,Maven,Maven 3,这是刚刚开始的。直到今天下午,我还能够在我的项目目录中运行mvn clean install,没有任何问题。我今天下午尝试这样做,但出现以下错误: MusikPolice$ mvn -X clean install Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 11:22:22-0400) Maven home: /Applications/apache-maven-3.1.1 Java vers

这是刚刚开始的。直到今天下午,我还能够在我的项目目录中运行
mvn clean install
,没有任何问题。我今天下午尝试这样做,但出现以下错误:

MusikPolice$ mvn -X clean install
Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 11:22:22-0400)
Maven home: /Applications/apache-maven-3.1.1
Java version: 1.7.0_45, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.9.1", arch: "x86_64", family: "mac"
[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from /Applications/apache-maven-3.1.1/conf/settings.xml
[DEBUG] Reading user settings from /var/empty/.m2/settings.xml
[DEBUG] Using local repository at /var/empty/.m2/repository
[ERROR] Could not create local repository at /var/empty/.m2/repository -> [Help 1]
org.apache.maven.repository.LocalRepositoryNotAccessibleException: Could not create local repository at /var/empty/.m2/repository
    at org.apache.maven.DefaultMaven.validateLocalRepository(DefaultMaven.java:505)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:191)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[ERROR] 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/LocalRepositoryNotAccessibleException
它建议我阅读的wiki页面没有太大帮助,只是建议如果Maven无法写入
~/.m2/repository/
目录,可能会发生这种情况


还有其他想法吗?

由于此日志消息:

[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from /Applications/apache-maven-3.1.1/conf/settings.xml
[DEBUG] Reading user settings from /var/empty/.m2/settings.xml
似乎Maven在使用红色
/Applications/apache-Maven-3.1.1/conf/settings.xml
后开始读取
/var/empty/.m2/settings.xml
,因此如果以下行未注释,请检查
/Applications/apache-Maven-3.1.1/conf/settings.xml

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" 
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <!-- localRepository
   | The path to the local repository maven will use to store artifacts.
   |
   | Default: ${user.home}/.m2/repository
  <localRepository>/path/to/local/repo</localRepository>
  -->


由于此日志消息,将
localRepository
设置为
/var/empty/

[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from /Applications/apache-maven-3.1.1/conf/settings.xml
[DEBUG] Reading user settings from /var/empty/.m2/settings.xml
似乎Maven在使用红色
/Applications/apache-Maven-3.1.1/conf/settings.xml
后开始读取
/var/empty/.m2/settings.xml
,因此如果以下行未注释,请检查
/Applications/apache-Maven-3.1.1/conf/settings.xml

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" 
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <!-- localRepository
   | The path to the local repository maven will use to store artifacts.
   |
   | Default: ${user.home}/.m2/repository
  <localRepository>/path/to/local/repo</localRepository>
  -->


并且将
localRepository
设置为
/var/empty/

您是否检查了环境变量?本垒打什么?你准备了什么maven环境变量?你检查过你的环境变量了吗?本垒打什么?你准备了什么maven env Var?