构建Spring MVC项目时出错

时间:2013-04-16 14:49:55

标签: eclipse maven spring-mvc maven-3 ubuntu-10.04

我已经下载了Eclipse STS 3.2.0并安装了Apache Tomcat 7,JDK 6和Maven 3.0.4,然后尝试使用Eclipse创建一个新的Spring MVC空项目。

然而,当我尝试运行这个'空'项目时,我总是遇到这个错误,即使我甚至没有编写任何一行代码,其中的所有代码都是使用Eclipse自动生成的

Errors occurred during the build.
Errors running builder 'Maven Project Builder' on project 'GoodProjectSTS'.
Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5
Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies  could not be resolved: Failed to read artifact descriptor for  org.apache.maven.plugins:maven-resources-plugin:jar:2.5
Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources- plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact  descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5
Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies  could not be resolved: Failed to read artifact descriptor for  org.apache.maven.plugins:maven-resources-plugin:jar:2.5

当我检查是否已安装Maven并使用

工作时
mvn --version

我在输出中得到以下内容

The program 'mvn' is currently not installed.  You can install it by typing:
sudo apt-get install maven2

我已经编辑了/ etc / enivronment并确保其中包含以下内容:

JAVA_HOME=”/usr/lib/jvm/java-6-sun”
M3_HOME=”/usr/local/apache-maven/apache-maven-3.0.2″
MAVEN_HOME=”/usr/local/apache-maven/apache-maven-3.0.2″
M3=”/usr/local/apache-maven/apache-maven-3.0.2/bin”

但是当我输入mvn -version

时,我仍然会遇到同样的错误

有人可以告诉我这里缺少什么吗?或者我如何解决这个问题并让空应用程序运行?

注意:我在Ubuntu 10.04

下运行上述内容

注2:我尝试卸载maven,然后使用http://lukieb.wordpress.com/2011/02/15/installing-maven-3-on-ubuntu-10-04-lts-server/中的说明重新安装,但没有成功(出现相同的错误),仍然mvn -version返回错误

由于

1 个答案:

答案 0 :(得分:0)

如果jar可用,请检查以下目录 {home directory} .m2 \ repository \ org \ apache \ maven \ plugins \ maven-resources-plugin \ 2.5 另外,尝试手动下载jar并将其添加到eclipse中的构建中并检查是否发生相同的错误

下载位置:http://mvnrepository.com/artifact/org.apache.maven.plugins/maven-resources-plugin/2.5