Spring Tool Suite首次使用pom.xml出现依赖异常解决办法

Ecplise 安装 spring-tool-suit
首次使用pom.xml出现依赖错误解决方法

  来自fair-j 转截请注明出处

  首先这个问题会在第一次使用STS的时候发生

  大体是新建一个带有maven支持的工程 或者直接从DashBorad中导入guide的时候

  都会出现pom.xml的异常 导致项目不能被编译

  会出现很多的依赖错误 我这边就复制了一个 在新建一个JPA项目的时候会出现:

  写道

  Description Resource Path Location Type
ArtifactDescriptorException: Failed to read artifact descriptor for org.springframework.boot:spring-boot-starter-web:jar:0.5.0.M6: ArtifactResolutionException: Failure to transfer org.springframework.boot:spring-boot-starter-web:pom:0.5.0.M6 from , resolution will not be reattempted until the update interval of spring-snapshots has elapsed or updates are forced. Original error: Could not transfer artifact org.springframework.boot:spring-boot-starter-web:pom:0.5.0.M6 from/to spring-snapshots (): No response received after 60000 pom.xml /gs-rest-service-complete line 1 Maven Dependency Problem

  解决方法其实很简单

  参照这里: s-right-after-creating

  只要在cmd中对出错的项目进行下mvn compile保证成功后 回到IDE中 如果项目还是有X或者感叹号的话

  再在项目上强制update一下就可以了

  如下:

  




  此外使用maven时用默认的仓库速度会过慢 下载很小的jar包都需要很久 推介使用oschina的源

  使用在这里:

  嫌麻烦的话 我这里有一份:

  < xml version="1.0" encoding="UTF-8" > H:\repository\jar nexus-osc * Nexus osc ;/url> jdk-1.4 1.4 nexus local private nexus ;/url> true false nexus local private nexus ;/url> true false


如果使用mvn compile 失败请参考:

http://jingyan.baidu.com/article/066074d645db24c3c21cb088.html

亲测,成功!


你可能感兴趣的:(spring)