我已经下载了 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 返回错误
谢谢