Maven无法获取从Spring 3.0.1升级到3.2.5的依赖关系

时间:2021-07-29 15:29:47

This issue is beyond my understanding now, I've invested quite enough time on it.

这个问题现在超出了我的理解范围,我投入了足够的时间。

I upgraded the Spring dependencies in my project from version 3.01 to version 3.2.5.RELEASE My project has Spring Hibernate & some other dependencies.

我将项目中的Spring依赖项从版本3.01升级到版本3.2.5.RELEASE我的项目有Spring Hibernate和其他一些依赖项。

Before updating the dependency maven was able to fetch the spring & all the dependencies from maven repo. After upgrading it started giving error for all the spring dependencies. For an instance

在更新依赖之前,maven能够从maven repo获取spring和所有依赖项。升级后,它开始为所有spring依赖项提供错误。例如

The POM for org.springframework:org.springframework.web:jar:3.2.5.RELEASE is missing, no dependency information available

I had to add the spring repository in my pom to download this

我不得不在我的pom中添加spring存储库来下载它

<repositories>
        <repository>
            <id>com.springsource.repository.bundles.release</id>
            <name>SpringSource Enterprise Bundle Repository - SpringSource Bundle
            Releases</name>
            <url>http://repo.springsource.com/maven/bundles/release</url>
        </repository>
        <repository>
            <id>com.springsource.repository.bundles.external</id>
            <name>SpringSource Enterprise Bundle Repository - External Bundle
            Releases</name>
            <url>http://repo.springsource.com/maven/bundles/external</url>
        </repository>
    </repositories>

But after adding this repository maven stopped fetching other dependencies giving the error

但添加此存储库后,maven停止获取其他依赖项,从而产生错误

Failed to execute goal on project : Could not resolve dependencies for project com.xx:xx:war:0.0.1-SNAPSHOT: Failed to collect dependencies for [junit:junit:jar:3.8.1 (test), javax.activation:activation:jar:1.1 (compile), antlr:antlr:jar:2.7.6 (compile), aopalliance:aopalliance:jar:1.0 (compile), asm:asm:jar:1.5.3 (compile), asm:asm-attrs:jar:1.5.3 (compile), cglib:cglib-nodep:jar:2.1_3 (compile), com.sun.faces:com.springsource.com.sun.faces:jar:1.2.0.09 (compile), commons-beanutils:commons-beanutils:jar:1.8.3 (compile), commons-cli:commons-cli:jar:1.1 (compile), commons-codec:commons-codec:jar:1.3 (compile), commons-collections:commons-collections:jar:3.2 (compile), commons-digester:commons-digester:jar:1.8 (compile), commons-email:commons-email:jar:1.0 (compile), commons-fileupload:commons-fileupload:jar:1.1.1 (compile), commons-io:commons-io:jar:1.2 (compile), commons-lang:commons-lang:jar:2.5 (compile), commons-logging:commons-logging:jar:1.1.1 (compile), dom4j:dom4j:jar:1.6.1 (compile), dumbster:dumbster:jar:1.6 (compile), net.sf.ehcache:ehcache:jar:1.2.3 (compile), org.hibernate:hibernate-core:jar:4.0.1.Final (compile), org.hibernate:hibernate-annotations:jar:3.3.1.GA (compile), org.hibernate.common:hibernate-commons-annotations:jar:tests:4.0.1.Final (compile), org.hibernate:hibernate-entitymanager:jar:4.0.1.Final (compile), org.hibernate:hibernate-search:jar:3.0.0.GA (compile), org.hibernate:hibernate-validator:jar:4.2.0.Final (compile), org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.1.Final (compile), com.ibm.icu:icu4j:jar:2.6.1 (compile), javax:javaee-api:jar:6.0 (compile), javassist:javassist:jar:3.4.GA (compile), javax.xml.bind:jaxb-api:jar:2.1 (compile), com.sun.xml.bind:jaxb-impl:jar:2.1.3 (compile), jaxen:jaxen:jar:1.1.1 (compile), jdom:jdom:jar:1.0 (compile), javax.servlet:jstl:jar:1.2 (compile), javax.transaction:jta:jar:1.1 (compile), log4j:log4j:jar:1.2.14 (compile), org.apache.lucene:lucene-core:jar:2.3.2 (compile), org.apache.lucene:lucene-highlighter:jar:2.0.0 (compile), javax.mail:mail:jar:1.4 (compile), org.apache.myfaces.core:myfaces-api:jar:2.1.12 (compile), org.apache.myfaces.core:myfaces-bundle:jar:2.1.12 (compile), org.apache.myfaces.core:myfaces-impl:jar:2.1.12 (compile), mysql:mysql-connector-java:jar:5.0.5 (compile), javax.persistence:persistence-api:jar:1.0 (compile), quartz:quartz:jar:1.5.2 (compile), com.rabbitmq:amqp-client:jar:3.5.3 (compile), org.slf4j:slf4j-api:jar:1.5.6 (compile), org.slf4j:slf4j-log4j12:jar:1.5.6 (compile), org.springframework.amqp:spring-amqp:jar:1.1.3.RELEASE (compile), org.springframework.amqp:spring-rabbit:jar:1.1.3.RELEASE (compile), org.springframework:org.springframework.aop:jar:3.2.5.RELEASE (compile), org.springframework:org.springframework.beans:jar:3.2.5.RELEASE (compile), org.springframework:org.springframework.context:jar:3.2.5.RELEASE (compile), org.springframework:spring-context-support:jar:3.2.5.RELEASE (compile), org.springframework:org.springframework.core:jar:3.2.5.RELEASE (compile), org.springframework:org.springframework.expression:jar:3.2.5.RELEASE (compile), org.springframework:org.springframework.jdbc:jar:3.2.5.RELEASE (compile), org.springframework:org.springframework.orm:jar:3.2.5.RELEASE (compile), org.springframework:org.springframework.transaction:jar:3.2.5.RELEASE (compile), org.springframework:org.springframework.web:jar:3.2.5.RELEASE (compile), org.springframework:spring-webmvc:jar:3.2.5.RELEASE (compile), org.springframework.security:spring-security-config:jar:3.1.3.RELEASE (compile), org.springframework.security:spring-security-core:jar:3.1.3.RELEASE (compile), org.springframework.security:spring-security-web:jar:3.1.3.RELEASE (compile), org.springframework.security:spring-security-taglibs:jar:3.1.3.RELEASE (compile), javax.xml.stream:stax-api:jar:1.0-2 (compile), javax.validation:validation-api:jar:1.0.0.GA (compile), xalan:xalan:jar:2.6.0 (compile), xerces:xercesImpl:jar:2.6.2 (compile), xml-apis:xml-apis:jar:1.3.02 (compile), xerces:xmlParserAPIs:jar:2.6.2 (compile), xom:xom:jar:1.0 (compile), joda-time:joda-time:jar:2.8.1 (compile), org.jadira.usertype:usertype.core:jar:4.0.0.GA (compile)]: Failed to read artifact descriptor for com.sun.faces:com.springsource.com.sun.faces:jar:1.2.0.09: Could not transfer artifact com.sun.faces:com.springsource.com.sun.faces:pom:1.2.0.09 from/to com.springsource.repository.bundles.release (http://repo.springsource.com/maven/bundles/release): null to http://repo.springsource.com/maven/bundles/release/com/sun/faces/com.springsource.com.sun.faces/1.2.0.09/com.springsource.com.sun.faces-1.2.0.09.pom: UnresolvedAddressException -> [Help 1]

Can anyone help me with any clue as to what is happening. Why can't maven download all the spring dependencies from maven repo?

任何人都可以帮我解决发生的事情。为什么maven不能从maven repo下载所有Spring依赖项?

Note: I already deleted .m2 folder & build the project anew but the error is still occuring.

注意:我已经删除了.m2文件夹并重新构建项目,但错误仍然存​​在。

pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.xx</groupId>
    <artifactId>xx</artifactId>
    <packaging>war</packaging>
    <version>0.0.1-SNAPSHOT</version>
    <name>xx Maven Webapp</name>
    <url>http://maven.apache.org</url>

    <properties>
        <spring.version>3.2.5.RELEASE</spring.version>
        <spring-security.version>3.1.3.RELEASE</spring-security.version>

    </properties>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>javax.activation</groupId>
            <artifactId>activation</artifactId>
            <version>1.1</version>
        </dependency>

        <dependency>
            <groupId>antlr</groupId>
            <artifactId>antlr</artifactId>
            <version>2.7.6</version>
        </dependency>

        <dependency>
            <groupId>aopalliance</groupId>
            <artifactId>aopalliance</artifactId>
            <version>1.0</version>
        </dependency>

        <dependency>
            <groupId>asm</groupId>
            <artifactId>asm</artifactId>
            <version>1.5.3</version>
        </dependency>

        <dependency>
            <groupId>asm</groupId>
            <artifactId>asm-attrs</artifactId>
            <version>1.5.3</version>
        </dependency>

        <dependency>
            <groupId>cglib</groupId>
            <artifactId>cglib-nodep</artifactId>
            <version>2.1_3</version>
        </dependency>

        <dependency>
            <groupId>com.sun.faces</groupId>
            <artifactId>com.springsource.com.sun.faces</artifactId>
            <version>1.2.0.09</version>
        </dependency>

        <dependency>
            <groupId>commons-beanutils</groupId>
            <artifactId>commons-beanutils</artifactId>
            <version>1.8.3</version>
        </dependency>

        <dependency>
            <groupId>commons-cli</groupId>
            <artifactId>commons-cli</artifactId>
            <version>1.1</version>
        </dependency>

        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <version>1.3</version>
        </dependency>

        <dependency>
            <groupId>commons-collections</groupId>
            <artifactId>commons-collections</artifactId>
            <version>3.2</version>
        </dependency>

        <dependency>
            <groupId>commons-digester</groupId>
            <artifactId>commons-digester</artifactId>
            <version>1.8</version>
        </dependency>

        <dependency>
            <groupId>commons-email</groupId>
            <artifactId>commons-email</artifactId>
            <version>1.0</version>
        </dependency>

        <dependency>
            <groupId>commons-fileupload</groupId>
            <artifactId>commons-fileupload</artifactId>
            <version>1.1.1</version>
        </dependency>

        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>1.2</version>
        </dependency>

        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>2.5</version>
        </dependency>

        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>1.1.1</version>
        </dependency>

        <dependency>
            <groupId>dom4j</groupId>
            <artifactId>dom4j</artifactId>
            <version>1.6.1</version>
        </dependency>

        <dependency>
            <groupId>dumbster</groupId>
            <artifactId>dumbster</artifactId>
            <version>1.6</version>
        </dependency>

        <dependency>
            <groupId>net.sf.ehcache</groupId>
            <artifactId>ehcache</artifactId>
            <version>1.2.3</version>
        </dependency>

        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>4.0.1.Final</version>
        </dependency>

        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-annotations</artifactId>
            <version>3.3.1.GA</version>
        </dependency>

        <dependency>
            <groupId>org.hibernate.common</groupId>
            <artifactId>hibernate-commons-annotations</artifactId>
            <version>4.0.1.Final</version>
            <classifier>tests</classifier>
        </dependency>

        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
            <version>4.0.1.Final</version>
        </dependency>

        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-search</artifactId>
            <version>3.0.0.GA</version>
        </dependency>

        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator</artifactId>
            <version>4.2.0.Final</version>
        </dependency>

        <dependency>
            <groupId>org.hibernate.javax.persistence</groupId>
            <artifactId>hibernate-jpa-2.0-api</artifactId>
            <version>1.0.1.Final</version>
        </dependency>

        <dependency>
            <groupId>com.ibm.icu</groupId>
            <artifactId>icu4j</artifactId>
            <version>2.6.1</version>
        </dependency>

        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-api</artifactId>
            <version>6.0</version>
        </dependency>

        <dependency>
            <groupId>javassist</groupId>
            <artifactId>javassist</artifactId>
            <version>3.4.GA</version>
        </dependency>

        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
            <version>2.1</version>
        </dependency>

        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-impl</artifactId>
            <version>2.1.3</version>
        </dependency>

        <dependency>
            <groupId>jaxen</groupId>
            <artifactId>jaxen</artifactId>
            <version>1.1.1</version>
        </dependency>

        <dependency>
            <groupId>jdom</groupId>
            <artifactId>jdom</artifactId>
            <version>1.0</version>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
        </dependency>

        <dependency>
            <groupId>javax.transaction</groupId>
            <artifactId>jta</artifactId>
            <version>1.1</version>
        </dependency>

        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.14</version>
        </dependency>

        <dependency>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-core</artifactId>
            <version>2.3.2</version>
        </dependency>

        <dependency>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-highlighter</artifactId>
            <version>2.0.0</version>
        </dependency>

        <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>mail</artifactId>
            <version>1.4</version>
        </dependency>

        <dependency>
            <groupId>org.apache.myfaces.core</groupId>
            <artifactId>myfaces-api</artifactId>
            <version>2.1.12</version>
        </dependency>

        <dependency>
            <groupId>org.apache.myfaces.core</groupId>
            <artifactId>myfaces-bundle</artifactId>
            <version>2.1.12</version>
        </dependency>

        <dependency>
            <groupId>org.apache.myfaces.core</groupId>
            <artifactId>myfaces-impl</artifactId>
            <version>2.1.12</version>
        </dependency>

        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.0.5</version>
        </dependency>

        <dependency>
            <groupId>javax.persistence</groupId>
            <artifactId>persistence-api</artifactId>
            <version>1.0</version>
        </dependency>

        <dependency>
            <groupId>quartz</groupId>
            <artifactId>quartz</artifactId>
            <version>1.5.2</version>
        </dependency>

        <dependency>
            <groupId>com.rabbitmq</groupId>
            <artifactId>amqp-client</artifactId>
            <version>3.5.3</version>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.5.6</version>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.5.6</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.amqp</groupId>
            <artifactId>spring-amqp</artifactId>
            <version>1.1.3.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.amqp</groupId>
            <artifactId>spring-rabbit</artifactId>
            <version>1.1.3.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>org.springframework.aop</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>org.springframework.beans</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>org.springframework.context</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context-support</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>org.springframework.core</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>org.springframework.expression</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>org.springframework.jdbc</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>org.springframework.orm</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>org.springframework.transaction</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>org.springframework.web</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-config</artifactId>
            <version>${spring-security.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-core</artifactId>
            <version>${spring-security.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-web</artifactId>
            <version>${spring-security.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-taglibs</artifactId>
            <version>${spring-security.version}</version>
        </dependency>

        <dependency>
            <groupId>javax.xml.stream</groupId>
            <artifactId>stax-api</artifactId>
            <version>1.0-2</version>
        </dependency>

        <dependency>
            <groupId>javax.validation</groupId>
            <artifactId>validation-api</artifactId>
            <version>1.0.0.GA</version>
        </dependency>

        <dependency>
            <groupId>xalan</groupId>
            <artifactId>xalan</artifactId>
            <version>2.6.0</version>
        </dependency>

        <dependency>
            <groupId>xerces</groupId>
            <artifactId>xercesImpl</artifactId>
            <version>2.6.2</version>
        </dependency>

        <dependency>
            <groupId>xml-apis</groupId>
            <artifactId>xml-apis</artifactId>
            <version>1.3.02</version>
        </dependency>

        <dependency>
            <groupId>xerces</groupId>
            <artifactId>xmlParserAPIs</artifactId>
            <version>2.6.2</version>
        </dependency>

        <dependency>
            <groupId>xom</groupId>
            <artifactId>xom</artifactId>
            <version>1.0</version>
        </dependency>

        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
            <version>2.8.1</version>
        </dependency>

        <dependency>
            <groupId>org.jadira.usertype</groupId>
            <artifactId>usertype.core</artifactId>
            <version>4.0.0.GA</version>
        </dependency>


    </dependencies>

    <repositories>
        <repository>
            <id>com.springsource.repository.bundles.release</id>
            <name>SpringSource Enterprise Bundle Repository - SpringSource Bundle
            Releases</name>
            <url>http://repo.springsource.com/maven/bundles/release</url>
        </repository>
        <repository>
            <id>com.springsource.repository.bundles.external</id>
            <name>SpringSource Enterprise Bundle Repository - External Bundle
            Releases</name>
            <url>http://repo.springsource.com/maven/bundles/external</url>
        </repository>
    </repositories>

    <build>
        <finalName>xxx</finalName>
    </build>
</project>

1 个解决方案

#1


1  

How did you get these groupIds + artifactIds + versions? If you go to http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.springframework%22 you'll see that the groupId is correct, the version as well, but you misspelled the artifactIds.

你是如何获得这些groupIds + artifactIds +版本的?如果你去http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.springframework%22,你会看到groupId是正确的,版本也是如此,但你拼错了artifactIds 。

#1


1  

How did you get these groupIds + artifactIds + versions? If you go to http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.springframework%22 you'll see that the groupId is correct, the version as well, but you misspelled the artifactIds.

你是如何获得这些groupIds + artifactIds +版本的?如果你去http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.springframework%22,你会看到groupId是正确的,版本也是如此,但你拼错了artifactIds 。