STS 3.7.3中的Spring MVC问题



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

描述资源路径位置类型

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


编辑

Mvn现在可以了,但pom.xml错误仍然存在,如果我删除错误并进行maven清理,我得到的错误为:

[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

首先,STS是在Eclipse上构建的。因此,您可以轻松地为STS安装IDE集成Eclipse IDE - M2Eclipse。你可以在这里看到。如果你想把它和这个集成插件一起使用,你不需要有一个本地的maven存储库。

从Eclipse工作区解决Maven依赖关系,而无需安装到本地Maven存储库

但也可以将maven用作本地系统存储库。下载在这里,按照这里的安装和配置步骤进行操作。

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


更新:

我会说从您的工作区中删除该项目,然后重试。从gitHub下载项目作为zip文件,然后再次将其导入到您的工作区。右键单击->导入->现有maven项目。

如果您需要使用代理进行连接,则必须在.m2文件夹中创建一个settings.xml。查看此处了解更多信息

最新更新