2

我在尝试运行 mvn 命令时遇到问题。这就是我正在做的事情:

    enaxromac:ios enaxro$ mvn -f TTTTT/pom.xml
[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project com.xxxxxx.xxxxxx.ios.xxxxxx:xxxx:2.0.0-SNAPSHOT (/Users/enaxro/projects/xxxxx/main/xxxxxx/xxx/xxxxxxx/pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM for com.xxxxx.xxxxx.ios:root:2.0.0-SNAPSHOT: Failure to find com.xxxxx.maven.parent:legacy:pom:1.0.11 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced and 'parent.relativePath' points at wrong local POM @ com.xxxx.xxxxxx.ios:root:2.0.0-SNAPSHOT, /Users/enaxro/projects/xxxx/main/xxxxx/ios/pom.xml, line 3, column 13 -> [Help 2]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[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/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

我的设置如下:

enaxromac:ios enaxro$ mvn --version
Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 08:51:28-0500)
Maven home: /usr/share/maven
Java version: 1.6.0_37, vendor: Apple Inc.
Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Default locale: en_US, platform encoding: MacRoman
OS name: "mac os x", version: "10.7.5", arch: "x86_64", family: "mac"
4

2 回答 2

2

检查您的 settings.xml 文件。它应该在

<Userdir>/.m2 

存储库目录旁边的目录。这是我们得到不可解决的父错误的主要原因之一。此外,对于其他可能的解决方案,请查看这篇文章:http: //java.dzone.com/articles/mavens-non-resolvable-parent

于 2014-03-04T00:40:45.673 回答
0

您的父 Pom 正在查看默认的 maven 存储库。您需要更改您的 settings.xml 并在此处添加存储库。

于 2013-03-14T04:06:46.947 回答