首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >弹簧artifactDescriptorException

弹簧artifactDescriptorException
EN

Stack Overflow用户
提问于 2014-01-15 16:32:54
回答 2查看 7.3K关注 0票数 0

嗨,我是Spring的新手,在STS上修改自动生成的spring项目,我在标记视图上得到了这个错误:

代码语言:javascript
复制
    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

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

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2014-01-15 18:54:36

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

代码语言:javascript
复制
<spring.version>3.1.1.RELEASE</spring.version>

我建议只使用其中的一个用于一致性和传递依赖。

票数 2
EN

Stack Overflow用户

发布于 2014-01-15 16:35:39

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

代码语言:javascript
复制
              <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}
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21142967

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档