Maven:在POM不可解析的父级上出错

时间:2013-03-14 03:40:22

标签: java ios macos maven

我在尝试运行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"

2 个答案:

答案 0 :(得分:2)

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

<Userdir>/.m2 

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

答案 1 :(得分:0)

您的父Pom正在查看默认的maven仓库。 您需要更改settings.xml并在那里添加repo。