我有一个依赖:Maven的解决作为组识别符号公共org.apache.commons.collections的集合,并不能找到我的POM版本3.2.1
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.1</version>
</dependency>
恕我直言,这是正确的依赖关系(比较http://mvnrepository.com/artifact/commons-collections/commons-collections/3.2.1 )。
但是当Maven试图解决这个问题,它试图为网址是:
Downloading: http://mvnrepository.com/org/apache/commons/commons-collections/3.2.1/commons-collections-3.2.1.pom
Downloading: http://central.maven.org/org/apache/commons/commons-collections/3.2.1/commons-collections-3.2.1.pom
Downloading: http://repo1.maven.org/org/apache/commons/commons-collections/3.2.1/commons-collections-3.2.1.pom
Downloading: https://oss.sonatype.org/content/repositories/snapshots/org/apache/commons/commons-collections/3.2.1/commons-collections-3.2.1.pom
Downloading: http://snapshots.repository.codehaus.org/org/apache/commons/commons-collections/3.2.1/commons-collections-3.2.1.pom
Downloading: http://repository.codehaus.org/org/apache/commons/commons-collections/3.2.1/commons-collections-3.2.1.pom
Downloading: http://repo.maven.apache.org/maven2/org/apache/commons/commons-collections/3.2.1/commons-collections-3.2.1.pom
[WARNING] The POM for org.apache.commons:commons-collections:jar:3.2.1 is missing, no dependency information available
Downloading: http://almvn.solnetsolutions.co.nz/content/groups/public/org/apache/commons/commons-collections/3.2.1/commons-collections-3.2.1.jar
Downloading: http://almvn.solnetsolutions.co.nz/content/repositories/releases/org/apache/commons/commons-collections/3.2.1/commons-collections-3.2.1.jar
Downloading: http://mvnrepository.com/org/apache/commons/commons-collections/3.2.1/commons-collections-3.2.1.jar
Downloading: http://central.maven.org/org/apache/commons/commons-collections/3.2.1/commons-collections-3.2.1.jar
Downloading: http://repo1.maven.org/org/apache/commons/commons-collections/3.2.1/commons-collections-3.2.1.jar
Downloading: https://oss.sonatype.org/content/repositories/snapshots/org/apache/commons/commons-collections/3.2.1/commons-collections-3.2.1.jar
Downloading: http://snapshots.repository.codehaus.org/org/apache/commons/commons-collections/3.2.1/commons-collections-3.2.1.jar
Downloading: http://repository.codehaus.org/org/apache/commons/commons-collections/3.2.1/commons-collections-3.2.1.jar
Downloading: http://repo.maven.apache.org/maven2/org/apache/commons/commons-collections/3.2.1/commons-collections-3.2.1.jar
这些都失败,如(恕我直言)它是错误的组ID(组织/阿帕奇/公地)。 它从哪里获得URL路径中的“org/apache/commons”?
我没有其他的依赖,甚至会提及org.apache在组ID。
Maven从哪里得到这个URL?
就是这么错了,为什么就不能正确地解决它: http://central.maven.org/maven2/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar
?
我Maven的设置是:
Apache Maven 3.0.4 (r1232337; 2012-01-17 21:44:56+1300)
Maven home: /home/solnet/apache-maven-3.0.4
Java version: 1.7.0_11, vendor: Oracle Corporation
Java home: /home/solnet/jdk1.7.0_11/jre
Default locale: en_NZ, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-358.2.1.el6.x86_64", arch: "amd64", family: "unix"
这是我在POM文件库设置:
<repositories>
<repository>
<id>mvnrepo</id>
<name>mvnrepo</name>
<url>http://mvnrepository.com</url>
</repository>
<repository>
<id>centralmvn</id>
<name>centralmvn</name>
<url>http://central.maven.org</url>
</repository>
<repository>
<id>mvnrepo2</id>
<name>mvnrepo2</name>
<url>http://repo1.maven.org</url>
</repository>
<repository>
<id>oss-sonatype-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</repository>
<repository>
<id>codehaus-snaphosts</id>
<name>Codehaus Snapshots</name>
<url>http://snapshots.repository.codehaus.org/</url>
</repository>
<repository>
<id>codehaus-releases</id>
<name>CodeHaus Releases</name>
<url>http://repository.codehaus.org/</url>
</repository>
/repositories>
这是 “MVN帮助:有效-POM” 输出 .. 。因为看起来太大,所以请参阅:http://pastebin.com/RHAkUmMu
而这是
的输出MVN依赖性:树-Dincludes = “org.apache.commons:公地集合”
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building mobilewebapp 1.1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://mvnrepository.com/org/apache/commons/commons-collections/3.2.1/commons-collections-3.2.1.pom
Downloading: http://central.maven.org/org/apache/commons/commons-collections/3.2.1/commons-collections-3.2.1.pom
Downloading: http://repo1.maven.org/maven2/org/apache/commons/commons-collections/3.2.1/commons-collections-3.2.1.pom
Downloading: https://oss.sonatype.org/content/repositories/snapshots/org/apache/commons/commons-collections/3.2.1/commons-collections-3.2.1.pom
Downloading: http://snapshots.repository.codehaus.org/org/apache/commons/commons-collections/3.2.1/commons-collections-3.2.1.pom
Downloading: http://repository.codehaus.org/org/apache/commons/commons-collections/3.2.1/commons-collections-3.2.1.pom
Downloading: http://repo.maven.apache.org/maven2/org/apache/commons/commons-collections/3.2.1/commons-collections-3.2.1.pom
Downloading: http://almvn.solnetsolutions.co.nz/content/groups/public/org/apache/commons/commons-collections/3.2.1/commons-collections-3.2.1.pom
Downloading: http://almvn.solnetsolutions.co.nz/content/repositories/releases/org/apache/commons/commons-collections/3.2.1/commons-collections-3.2.1.pom
[WARNING] The POM for org.apache.commons:commons-collections:jar:3.2.1 is missing, no dependency information available
Downloading: http://mvnrepository.com/org/apache/commons/commons-collections/3.2.1/commons-collections-3.2.1.jar
Downloading: http://central.maven.org/org/apache/commons/commons-collections/3.2.1/commons-collections-3.2.1.jar
Downloading: http://repo1.maven.org/maven2/org/apache/commons/commons-collections/3.2.1/commons-collections-3.2.1.jar
Downloading: https://oss.sonatype.org/content/repositories/snapshots/org/apache/commons/commons-collections/3.2.1/commons-collections-3.2.1.jar
Downloading: http://snapshots.repository.codehaus.org/org/apache/commons/commons-collections/3.2.1/commons-collections-3.2.1.jar
Downloading: http://repository.codehaus.org/org/apache/commons/commons-collections/3.2.1/commons-collections-3.2.1.jar
Downloading: http://repo.maven.apache.org/maven2/org/apache/commons/commons-collections/3.2.1/commons-collections-3.2.1.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.986s
[INFO] Finished at: Thu Sep 04 11:28:24 NZST 2014
[INFO] Final Memory: 9M/107M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project mobilewebapp: Could not resolve dependencies for project nz.co.nzlotteries:mobilewebapp:war:1.1.0-SNAPSHOT: Could not find artifact org.apache.commons:commons-collections:jar:3.2.1 in mvnrepo (http://mvnrepository.com) -> [Help 1]
[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/DependencyResolutionException
它在中央存储库中的权利可能在您的'pom.xml'中覆盖了存储库,导致它跳过默认存储库 – 2014-09-03 22:40:56
我也附加了我的存储库设置。 – 2014-09-03 22:56:55
从'mvn help:effective-pom'的输出粘贴库[ – 2014-09-03 22:57:45