1. 程式人生 > >Maven獲取包的時候錯誤和build錯誤 ArtifactTransferException: Failure to transfer

Maven獲取包的時候錯誤和build錯誤 ArtifactTransferException: Failure to transfer



ArtifactTransferException: Failure to transfer xalan:xalan:jar:2.6.0 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 xalan:xalan:jar:2.6.0 from/to central (http://repo.maven.apache.org/maven2): No response received after 60000

解決方案在pom.xml檔案<build>標籤後面加上<defaultGoal>compile</defaultGoal>即可即

<build>
  <finalName>alpha_mvn</finalName>
  <defaultGoal>compile</defaultGoal>
 </build>

可能是網路原因,造成下載中斷的異常,配置好上面節點,重新下載(Maven install 或者 build)就行了。