嗨,我是 Spring 的新手,在 STS 修改自动生成的 spring mvc 项目时,我在标记 View 上收到此错误:
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.xml 中定义的 org.springframework-version
。
<spring.version>3.1.1.RELEASE</spring.version>
我建议仅使用其中之一来实现一致性和传递依赖。
关于java - Spring 工件DescriptorException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21142967/