STS 3.7.3中的Spring MVC问题

时间:2016-04-19 07:00:16

标签: spring git maven

我在STS 3.7.3中导入https://github.com/spring-projects/spring-mvc-showcase时收到此错误:---

描述资源路径位置类型

来自https://repo.maven.apache.org/maven2

Failure to transfer org.codehaus.mojo:aspectj-maven-plugin:pom:1.2缓存在本地存储库中,在中心的更新间隔过去或强制更新之前,不会重新尝试解析。原始错误:无法传输工件org.codehaus.mojo:aspectj-maven-plugin:pom:1.2 from/to central: connect timed out pom.xml /spring-mvc-showcase第1行Maven pom加载问题

修改

Mvn现在还可以,但是如果我删除了错误并且maven清理了pom.xml错误仍然存​​在,我会收到错误:

[INFO] https://repo.maven.apache.org/maven2/org/codehaus/mojo/aspectj-maven-plugin/1.2/aspectj-maven-plugin-1.2.pom [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [ERROR] Plugin org.codehaus.mojo:aspectj-maven-plugin:1.2 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.codehaus.mojo:aspectj-maven-plugin:jar:1.2: Could not transfer artifact org.codehaus.mojo:aspectj-maven-plugin:pom:1.2 from/to central: connect timed out -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException

1 个答案:

答案 0 :(得分:0)

首先,STS建立在Eclipse之上。因此,您可以轻松地为STS安装IDE集成Eclipse IDE - M2Eclipse。你可以看到here的方式。如果您想将它与此集成插件一起使用,则无需拥有本地maven存储库。

  

从Eclipse工作区解析Maven依赖项而不安装到本地Maven存储库

但它也可以将maven用作本地系统存储库。下载为here,并按照安装和配置here.

的步骤进行操作

要查看您是否完成了有效的maven安装,可以通过在mvn -v中输入cmd shell或使用STS - >来测试它。 right click on your project - > run as - > maven build or maven install.

<强>更新

我想说从您的工作区删除项目并再次尝试。从gitHub下载项目作为zip文件,然后再将其导入您的工作区。右键单击 - &gt;导入 - &gt;现有的maven项目。

如果您需要为连接使用代理,则必须在settings.xml文件夹中创建.m2Look here for more info