Packaging error Could not find artifact jdk.tools:jdk.tools:jar:1.6

Missing artifact jdk.tools:jdk.tools:jar:1.6 

Maven reports Missing artifact jdk.tools:jdk.tools:jar:1.7

Packing error message:

Failed to execute goal on project data-front: Could not resolve dependencies for project com.baidu.feedback:data-front:jar:1.0.0-SNAPSHOT: Could not find artifact jdk.tools:jdk.tools:jar:1.6 at specified path /home/cmc/opt/java/jdk-11.0.2/../lib/tools.jar -> [Help 1]

 

solution:

A: Just add the following code in the pom file

		<dependency>
			<groupId>jdk.tools</groupId>
			<artifactId>jdk.tools</artifactId>
			<version>1.7</version>
			<scope>system</scope>
			<systemPath>${JAVA_HOME}/lib/tools.jar</systemPath>
		</dependency>

B: You can also manually install tools.jar in the local warehouse

mvn install:install-file -DgroupId=jdk.tools -DartifactId=jdk.tools -Dpackaging=jar -Dversion=1.6 -Dfile=tools.jar -DgeneratePom=true

Then add in pom.xml:

<dependency>
    <groupId>jdk.tools</groupId>
    <artifactId>jdk.tools</artifactId>
    <version>1.6</version>
</dependency>

 

Guess you like

Origin blog.csdn.net/xiangwang2016/article/details/107283671