【问题标题】:Spring artifactDescriptorException春季工件描述符异常
【发布时间】:2014-02-04 05:59:00
【问题描述】:

您好,我是 Spring 的新手,在 STS 修改自动生成的 spring mvc 项目时,我在标记视图中收到此错误:

    Description Resource    Path    Location    Type
ArtifactDescriptorException: Failed to read artifact descriptor for org.springframework:spring-context:jar:${spring.version}: ArtifactResolutionException: Failure to transfer org.springframework:spring-context:pom:${spring.version} from 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. Original error: Could not transfer artifact org.springframework:spring-context:pom:${spring.version} from/to central (http://repo.maven.apache.org/maven2): Illegal character in path at index 72: http://repo.maven.apache.org/maven2/org/springframework/spring-context/${spring.version}/spring-context-${spring.version}.pom    pom.xml /MMASGIS7   line 1  Maven Dependency Problem

你可以在http://pastebin.com/DkKzG2DR 看到我的 pom.xml 你能告诉我正确的方向来解决它吗?

【问题讨论】:

    标签: java spring-mvc maven-2


    【解决方案1】:

    您将两个属性用于同一目的:即 org.springframework-versionspring.version 。只使用其中一个,在 pom 的其余部分中引用相同的内容。

                  <properties>
                            <java-version>1.6</java-version>
                            <org.springframework-version>3.1.1.RELEASE</org.springframework-version>
                                  or    
                            <spring.version>3.0.5.RELEASE</spring.version>
                            <org.aspectj-version>1.6.10</org.aspectj-version>
                            <org.slf4j-version>1.6.6</org.slf4j-version>                       
                    </properties>
    
    
    Since you have alreay defined `org.springframework-version` , You can replace ${spring.version} by ${org.springframework-version}
    

    【讨论】:

      【解决方案2】:

      maven 运行时无法解析依赖项,因为缺少属性,它无法解析您指定的版本。 将此属性添加到 pom.xml 文件或完全删除 spring.version 并使用您已经在 pom.xml 中定义的 org.springframework-version

      <spring.version>3.1.1.RELEASE</spring.version>
      

      我建议只使用其中之一来实现一致性和传递依赖。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-12-13
        • 2015-05-18
        • 2014-03-14
        • 2015-09-30
        • 2013-03-20
        • 2012-02-10
        相关资源
        最近更新 更多