2014-01-15 22 views
0

您好我是一個新手到春天,在STS對矯正的自動生成Spring MVC的項目,我上標記這個錯誤觀點:春artifactDescriptorException

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您可以在正確的方向解決我的問題?

回答

2

maven運行時不能解決依賴關係,因爲它不能解決你自從屬性丟失以來指定的版本。 將此屬性添加到pom.xml文件或完全刪除spring.version並使用您已在您的pom中定義的org.springframework-version

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

我建議只使用其中之一來保持一致性和傳遞依賴性。

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}