我试图使用cargo插件从Eclipse内部在本地Jetty容器中运行web应用程序。这似乎是工作的其他人与完全相同的pom.xml,但我得到这个错误:
[ERROR] Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.0.3:start (default-cli) on project wsc: Failed to resolve dependency: C:Program FilesJavalibtools.jar -> [Help 1]
如何解决这个问题?本项目设置为使用jdk1.7.0作为"JRE系统库"。我用"-vm"启动Eclipse,甚至JAVA_HOME也被设置为JDK路径。
任何想法?我研究这个已经有一段时间了,对此我非常着迷。关于将tools.jar作为依赖项的文档对我没有帮助。
重要提示:这似乎可以在Eclipse之外工作,例如与mvn -P local cargo:start
。
从Eclipse启动时的程序输出:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Web Services Computing 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- cargo-maven2-plugin:1.0.3:start (default-cli) @ wsc ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.324s
[INFO] Finished at: Sat Oct 22 19:10:18 CEST 2011
[INFO] Final Memory: 15M/107M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.0.3:start (default-cli) on project wsc: Failed to resolve dependency: C:Program FilesJavalibtools.jar -> [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/MojoExecutionException
依赖树输出(也从Eclipse开始):
[INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ wsc ---
[INFO] de.tum.ibis.wsc:wsc:war:0.0.1-SNAPSHOT
[INFO] +- junit:junit:jar:3.8.1:test
[INFO] - javax.servlet:servlet-api:jar:2.5:compile
[INFO] ------------------------------------------------------------------------
您必须使用jdk而不是jre来启动eclipse。如果你编辑你的eclipse.ini并把jdk放到vm参数中,它应该可以工作。
-vm
C:/java_1_6/jdk/bin/javaw.exe