打包报错 Could not find artifact jdk.tools:jdk.tools:jar:1.6

缺少工件jdk.tools:jdk.tools:jar:1.6 

Maven报错Missing artifact jdk.tools:jdk.tools:jar:1.7

打包报错信息:

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]

 

解决方案:

A:在pom文件中添加如下代码即可

		
			jdk.tools
			jdk.tools
			1.7
			system
			${JAVA_HOME}/lib/tools.jar
		

B: 也可以在本地仓库中手动安装tools.jar

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

然后在pom.xml中添加:


    jdk.tools
    jdk.tools
    1.6

 

你可能感兴趣的:(异常处理)