天天看點

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

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>

以上方法親自驗證過

本文轉自 yntmdr 51CTO部落格,原文連結:http://blog.51cto.com/yntmdr/1759424,如需轉載請自行聯系原作者