2010-07-28 17 views
5

Khi tôi chạy "thực hiện thực" trong Roo tôi nhận được:com.sun: công cụ: jar: 1.4.2 mất tích khi chạy "thực hiện thực" trong 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] ------------------------------------------------------------------------ 

Cố gắng tải về các công cụ của 1.4.2 .jar và chạy mvn install: install-file -DgroupId = com.sun -DartifactId = tools -Dversion = 1.4.2 -Dpackaging = jar -Dfile =/path/to/file nhưng nó không giải quyết được vấn đề.

Chạy ubuntu 10.04 và maven 2.2

Mọi đề xuất?

Trả lời

4

Theo Spring Source Roo and missing com.sun:tools:jar:1.4.2:

Nếu bạn đang cố gắng để có được phiên bản mới nhất của SpringSource ROO làm việc, với x64 Java JDK, chẳng hạn như JDK mới nhất 1.6 cập nhật 20, có may thiếu tools.jar từ thư mục mặc định lib\ của JDK (tut tut tut Sun/Oracle). Điều này sẽ ngăn không cho Roo hoạt động và do đó ngăn chặn việc biên dịch Maven. Bạn sẽ lẽ thấy một lỗi tương tự như sau:

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. 

Để sửa lỗi này, cài đặt một thêm x86 JDK, repoint các JAVA_HOME và PATH cho JDK mới và khởi động lại quá trình mvn

+0

Tôi tự hỏi nếu nó muốn được giá trị kiểm tra cập nhật 1.6 21 để xem họ có thêm nó không. Chắc là không. – Powerlord

+0

@ R.Bemrose: Chắc chắn là đáng để kiểm tra nhưng tôi quá lười biếng khi cài đặt một JDK 64 bit trên nền tảng 32 bit của mình. –

+0

Tôi sẽ phải nhớ khi tôi ở nhà ... Tôi có một Java 6u21 JDK 64 bit được cài đặt ở đó; mặc dù cho Windows. – Powerlord

5

Bổ sung thông số môi trường hệ thống của bạn JAVA_HOME vào thư mục JDK (1.5+) thay vì JRE.

1

tôi nghĩ rằng tôi đã có java_home đặt thành jdk, nhưng tôi đoán trong slackware cả jre và jdk được cài đặt trong cùng một thư mục. có cả hai cài đặt gây ra vấn đề này. tôi gỡ bỏ cài đặt cả hai, và cài đặt lại jdk (để được an toàn) và nó cố định nó.

0

Thêm phụ thuộc này vào tệp pom.xml.

trong thuộc tính <systemPath> bạn phải ghi đường dẫn lib JDK của mình.

<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> 
0

Tôi cũng gặp sự cố tương tự và cố định int theo cách sau.

Chuyển đến thư mục lib của đường dẫn cài đặt JDK trong dấu nhắc lệnh. Thực hiện lệnh dưới đây để cài đặt để cài đặt tools.jar. $ Mvn cài đặt: cài đặt file -DgroupId = sun.jdk -DartifactId = công cụ -Dpackaging = jar -Dversion = 1,6 -Dfile = tools.jar

http://parameshk.blogspot.in

Các vấn đề liên quan