Add tools.jar to maven repository

A way to fix the following error:

6/23/12 1:50:22 PM CEST: Missing artifact com.sun:tools:jar:1.4.2:compile

The tools.jar is part of all JDK’s and therefore there is no need to fetch this dependency from any repo. Therefore the easiest thing is to add this jar to the local repository.

Locate the tools.jar in the JDK and run this command:

mvn install:install-file -DgroupId=com.sun -DartifactId=tools -Dversion=1.4.2 -Dpackaging=jar -Dfile=“C:Program FilesJavajdk1.6.0_26libtools.jar”

 

As reference the dependency:

<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.4.2</version>
</dependency>

Leave a comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.