当我在Roo中运行“执行日食”时,我得到了:
roo> perform eclipse
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building bugzter
[INFO] task-segment: [eclipse:clean, eclipse:eclipse]
[INFO] ------------------------------------------------------------------------
[INFO] [eclipse:clean {execution: default-cli}]
[INFO] Deleting file: .project
[INFO] Deleting file: .classpath
[INFO] Deleting file: .wtpmodules
[INFO] Deleting file: .component
[INFO] Deleting file: org.eclipse.wst.common.component
[INFO] Deleting file: org.eclipse.wst.common.project.facet.core.xml
[INFO] Deleting file: org.eclipse.jdt.core.prefs
[INFO] Deleting file: org.eclipse.ajdt.ui.prefs
[INFO] Preparing eclipse:eclipse
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
Missing:
----------
1) com.sun:tools:jar:1.4.2
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=com.sun -DartifactId=tools -Dversion=1.4.2 -Dpackaging=jar -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=com.sun -DartifactId=tools -Dversion=1.4.2 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
Path to dependency:
1) org.codehaus.mojo:aspectj-maven-plugin:maven-plugin:1.0
2) com.sun:tools:jar:1.4.2
----------
1 required artifact is missing.
for artifact:
org.codehaus.mojo:aspectj-maven-plugin:maven-plugin:1.0
from the specified remote repositories:
com.springsource.repository.bundles.release (http://repository.springsource.com/maven/bundles/release),
com.springsource.repository.bundles.external (http://repository.springsource.com/maven/bundles/external),
central (http://repo1.maven.org/maven2),
codehaus.org (http://repository.codehaus.org),
com.springsource.repository.bundles.milestone (http://repository.springsource.com/maven/bundles/milestone),
com.springsource.repository.bundles.snapshot (http://repository.springsource.com/maven/bundles/snapshot),
snapshots (http://snapshots.repository.codehaus.org)
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Wed Jul 28 20:57:52 CEST 2010
[INFO] Final Memory: 30M/298M
[INFO] ------------------------------------------------------------------------
尝试下载tools-1.4.2.jar并运行mvn install:install-file -DgroupId = com.sun -DartifactId = tools -Dversion = 1.4.2 -Dpackaging = jar -Dfile = / path / to / file但它没有解决问题。
运行ubuntu 10.04和maven 2.2
有什么建议吗?
答案 0 :(得分:5)
将系统环境参数JAVA_HOME重新指向JDK(1.5+)目录而不是JRE。
答案 1 :(得分:4)
根据Spring Source Roo and missing com.sun:tools:jar:1.4.2:
如果您正在尝试获取最新信息 SpringSource ROO的版本工作, 用x64 Java JDK,比如 最新的JDK 1.6更新20,有 不幸的是,缺少tools.jar JDK的默认
lib\
目录 (太,太太/甲骨文)。这将 防止Roo工作,因此 防止Maven编译。你会 可能会看到类似这样的错误:Error message: Missing: ---------- 1) com.sun:tools:jar:1.4.2 Try downloading the file manually from the project website. Then, install it using the command: mvn install:install-file -DgroupId=com.sun -DartifactId=tools -Dversion=1.4.2 -Dpackaging=jar -Dfile=/path/to/file Alternatively, if you host your own repository you can deploy the file there: mvn deploy:deploy-file -DgroupId=com.sun -DartifactId=tools -Dversion=1.4.2 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id] ---------- 1 required artifact is missing.
要更正此错误,请安装 额外的x86 JDK,重新命名 JAVA_HOME和PATH到新的JDK 并重新启动mvn进程
答案 2 :(得分:1)
我以为我把java_home设置为jdk,但我想在slackware中jre和jdk都安装在同一个文件夹中。两个安装都导致了这个问题。我卸载了两个,并重新安装了jdk(为了安全)并修复了它。
答案 3 :(得分:0)
在pom.xml文件中添加此依赖项。
在<systemPath>
属性中,您必须编写JDK lib路径。
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.4.2</version>
<scope>system</scope>
<systemPath>C:/Program Files/Java/jdk1.6.0_30/lib/tools.jar</systemPath>
</dependency>
答案 4 :(得分:0)
我也有类似的问题,并按以下方式修复。
在命令提示符下转到JDK安装路径的lib目录。执行以下命令安装以安装tools.jar。 $ mvn install:install-file -DgroupId = sun.jdk -DartifactId = tools -Dpackaging = jar -Dversion = 1.6 -Dfile = tools.jar