Eclipse spring工具套件spring mvc项目-创建后立即出现22个问题

Eclipse spring工具套件spring mvc项目-创建后立即出现22个问题,eclipse,maven,spring-mvc,eclipse-plugin,Eclipse,Maven,Spring Mvc,Eclipse Plugin,所以,我下载并安装了STS,然后我创建了一个新的SpringMVC项目。紧接着,sts提醒我22个问题,它们是: Description Resource Path Location Type Missing artifact aopalliance:aopalliance:jar:1.0 pom.xml /ContactManager line 1 Maven Dependency Problem Missing artifact org.spring

所以,我下载并安装了STS,然后我创建了一个新的SpringMVC项目。紧接着,sts提醒我22个问题,它们是:

Description Resource    Path    Location    Type
Missing artifact aopalliance:aopalliance:jar:1.0    pom.xml /ContactManager line 1          Maven Dependency Problem
Missing artifact org.springframework:spring-beans:jar:3.1.1.RELEASE pom.xml /ContactManager line 1  Maven Dependency Problem
Missing artifact org.springframework:spring-context:jar:3.1.1.RELEASE   pom.xml /ContactManager line 1  Maven Dependency Problem
Missing artifact org.springframework:spring-aop:jar:3.1.1.RELEASE   pom.xml /ContactManager line 1  Maven Dependency Problem
ArtifactDescriptorException: Failed to read artifact descriptor for org.slf4j:slf4j-api:jar:1.6.6: ArtifactResolutionException: Failure to transfer org.slf4j:slf4j-api:pom:1.6.6 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.slf4j:slf4j-api:pom:1.6.6 from/to central (http://repo.maven.apache.org/maven2): C:\Users\Skeeve\.m2\repository\org\slf4j\slf4j-api\1.6.6\slf4j-api-1.6.6.pom.ahc3656264e3b414ddf (Не удается найти указанный файл)   pom.xml /ContactManager line 1  Maven Dependency Problem
Missing artifact org.slf4j:jcl-over-slf4j:jar:1.6.6 pom.xml /ContactManager line 1  Maven Dependency Problem
Missing artifact org.aspectj:aspectjrt:jar:1.6.10   pom.xml /ContactManager line 1  Maven Dependency Problem
Missing artifact org.springframework:spring-web:jar:3.1.1.RELEASE   pom.xml /ContactManager line 1  Maven Dependency Problem
Missing artifact org.springframework:spring-context-support:jar:3.1.1.RELEASE   pom.xml /ContactManager line 1  Maven Dependency Problem
Missing artifact org.springframework:spring-webmvc:jar:3.1.1.RELEASE    pom.xml /ContactManager line 1  Maven Dependency Problem
Missing artifact org.springframework:spring-asm:jar:3.1.1.RELEASE   pom.xml /ContactManager line 1  Maven Dependency Problem
Missing artifact org.springframework:spring-expression:jar:3.1.1.RELEASE    pom.xml /ContactManager line 1  Maven Dependency Problem
Missing artifact org.springframework:spring-core:jar:3.1.1.RELEASE  pom.xml /ContactManager line 1  Maven Dependency Problem
Missing artifact junit:junit:jar:4.7    pom.xml /ContactManager line 1  Maven Dependency Problem
Missing artifact javax.servlet:jstl:jar:1.2 pom.xml /ContactManager line 1  Maven Dependency Problem
Missing artifact javax.servlet.jsp:jsp-api:jar:2.1  pom.xml /ContactManager line 1  Maven Dependency Problem
Missing artifact javax.servlet:servlet-api:jar:2.5  pom.xml /ContactManager line 1  Maven Dependency Problem
Missing artifact javax.inject:javax.inject:jar:1    pom.xml /ContactManager line 1  Maven Dependency Problem
Missing artifact log4j:log4j:jar:1.2.15 pom.xml /ContactManager line 1  Maven Dependency Problem
Missing artifact org.slf4j:slf4j-log4j12:jar:1.6.6  pom.xml /ContactManager line 1  Maven Dependency Problem

Description Resource    Path    Location    Type
The project cannot be built until build path errors are resolved    ContactManager      Unknown Java Problem

Description Resource    Path    Location    Type
The container 'Maven Dependencies' references non existing library 'C:\Users\Skeeve\.m2\repository\org\springframework\spring-context\3.1.1.RELEASE\spring-context-3.1.1.RELEASE.jar'   ContactManager      Build path  Build Path Problem

我怎样才能解决这个问题?谢谢你

你有代理人吗?如果是这样,您需要配置Maven来使用它


如果不是这样,只需右键单击您的项目并选择Maven->Update project Configuration。这应该行得通。可能您必须清理/刷新项目。

在第一次创建新的STS项目时,我也遇到了很多错误。这似乎只有在我没有任何Maven存储库或以前没有启动/使用Maven的情况下才会发生。在我的例子中,我通过手动从命令行启动Maven命令来解决这个问题。尝试“cd”到包含pom.xml的项目目录,并从那里调用STS附带的mvn

   cd c:\users\name\sts-projects\projectname
   c:\programs\springsource\apache-maven-3.0.3\bin\mvn compile

然后,打开STS,右键单击项目名称,选择“Maven”,“更新项目…”选择“强制更新快照/发布”。不要选择“脱机”。

clean/refresh添加了一个新问题:“未找到描述资源路径位置类型类”“org.springframework.web.servlet.view.InternalResourceViewResolver”“[配置集:ContactManager/web上下文]servlet context.xml/ContactManager/src/main/webapp/WEB-INF/spring/appServlet第19行springbeans问题’我没有Maven->更新项目配置,我有Maven->更新项目。。。选项这是你的意思吗?@OP,万一你错过了它-proxy指的是互联网代理。通常,如果您使用的是公司的互联网,出于安全目的,您会有某种代理。查看如何设置maven代理配置。这是必要的,这样maven就可以从服务器上的中央存储库中查找缺少的工件net@Skeeze是的,这是一个更新项目。只需单击此按钮,选择您的项目,保持所有设置不变,您的项目就会正常工作。@gerrytan我已经用maven导入了另一个项目,一切正常。所以,我想情况并非如此?非常适合我,非常感谢!我还建议每个遇到相同问题的人设置环境变量,这样他们就可以打开项目文件夹并运行“mvn编译”。下面是链接,例如:勾选强制更新快照/发布复选框为我做到了!Thanksthanks..解决了我的问题..ArtifactTransferException:传输失败org.aspectj:aspectjrt:jar