Maven将commons collections groupid解析为org.apache.commons.collections和can';找不到版本3.2.1

Maven将commons collections groupid解析为org.apache.commons.collections和can';找不到版本3.2.1,maven,dependencies,resolve,apache-commons-collection,Maven,Dependencies,Resolve,Apache Commons Collection,在我的pom中,我有一个依赖项: <dependency> <groupId>commons-collections</groupId> <artifactId>commons-collections</artifactId> <version>3.2.1</version> </dependency> 这些都失败了,因为(IMHO)是错误的组id(org/apache/co

在我的pom中,我有一个依赖项:

<dependency>
    <groupId>commons-collections</groupId>
    <artifactId>commons-collections</artifactId>
    <version>3.2.1</version>
</dependency>
这些都失败了,因为(IMHO)是错误的组id(org/apache/commons)。 它从哪里获得URL路径中的“org/apache/commons”

我没有在组id中提到org.apache的其他依赖项

Maven从哪里获得此URL

它是如此错误,为什么它不能正确地解决它:

?

我的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>

您配置了无效的存储库,若要修复它,请将
mvnrepo2
更改为
http://repo1.maven.org/maven2/

好的,最后这个问题的真正答案实际上是: 我有另一个项目,这个项目也有错误的groupid。因此,当Maven构建项目时,它使用依赖项的pom来解析jar

所以我基本上遇到了一个级联问题,我只需要从底部开始解决问题,而不是从顶部开始


感谢所有提供的帮助

它就在中央存储库上,您的
pom.xml
中可能覆盖了存储库,导致它跳过默认存储库。我还附加了我的存储库设置。从
mvn help:effective pom
的输出中粘贴存储库,并且仍然使用此groupId,这完全是错误的:)为什么它甚至会查找URL路径为org.apache.commons的包?这个定义在我的pom文件中根本不存在。我已经在帖子中添加了mvn help:effective pom的输出,它也位于:这可能是真的,但如果我这样做,它仍然无法正确解析组id。它试图从中检索JAR的URL是:Downloading:这仍然是错误的组id。正确的URL可能是从其他依赖项中通过传递方式将其提取出来,让我们查找它
mvn依赖项:tree-Dincludes=“org.apache.commons:commons collections”
itI已经附加了mvn依赖项的输出:tree-Dincludes=“org.apache.commons:commons collections”请删除/注释除mvnrepo2之外的所有存储库,然后再试一次,这样可以正常工作。我认为这与本地maven存储库有关。我认为发生的事情是,之前试图修复它时,jar被上传到一个私有的Nexus repo中,使用了错误的groupId!出于某种原因,这仍然会影响修复依赖关系后的解决方式。
    <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>
[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