linux中用eclipse 新建maven project,pom.xml中报Missing artifact jdk.tools:jdk.tools:jar:1.7

 

解决方法:

    在pom.xml中添加如下依赖:

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

也可以在本地仓库中手动安装tools.jar,如下
    mvn install:install-file -DgroupId=jdk.tools -DartifactId=jdk.tools -Dpackaging=jar     -Dversion=1.6 -Dfile=tools.jar -DgeneratePom=true
    然后在pom.xml中添加:
        <dependency>
            <groupId>jdk.tools</groupId>
            <artifactId>jdk.tools</artifactId>
            <version>1.7</version>
        </dependency>

以上方法亲自验证过

相关文章:

  • 2021-12-29
  • 2022-12-23
  • 2021-09-20
  • 2022-12-23
  • 2022-12-23
  • 2021-06-17
  • 2021-11-12
猜你喜欢
  • 2021-09-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-18
相关资源
相似解决方案