5

Roo で「perform eclipse」を実行すると、次のようになります。

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を実行しています

助言がありますか?

4

5 に答える 5

5

システム環境パラメータ JAVA_HOME を、JRE ではなく JDK (1.5+) ディレクトリに再ポイントします。

于 2010-12-21T13:43:20.173 に答える
4

Spring Source Rooによると、欠落している com.sun:tools:jar:1.4.2 :

SpringSource ROO の最新バージョンを、最新の JDK 1.6 update 20 などの x64 Java JDK で動作させようとしている場合、残念ながら、lib\JDK のデフォルト ディレクトリ (tut tut tut Sun/オラクル)。これにより、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 プロセスを再起動します。

于 2010-07-28T20:25:53.483 に答える
1

この依存関係を 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> 
于 2013-07-12T06:58:16.967 に答える
1

java_home が jdk に設定されていると思っていましたが、slackware では jre と jdk の両方が同じフォルダーにインストールされると思います。両方をインストールすると、この問題が発生しました。私は両方をアンインストールし、(安全のために)jdkを再インストールし、修正しました。

于 2011-08-25T18:52:38.087 に答える
0

私も同様の問題を抱えていて、次の方法で修正しました。

コマンド プロンプトで JDK インストール パスの lib ディレクトリに移動します。以下のコマンドを実行してインストールし、tools.jar をインストールします。$mvn install:install-file -DgroupId=sun.jdk -DartifactId=tools -Dpackaging=jar -Dversion=1.6 -Dfile=tools.jar

http://parameshk.blogspot.in

于 2014-02-06T07:17:46.080 に答える