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

    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
您能在正确的方向上给我解决的方法吗?

最佳答案

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

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


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

关于java - Spring artifactDescriptorException,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/21142967/

10-09 07:29