解決Maven工程中報 Missing artifact jdk.tools:jdk.tools

解決方法:xml

    在pom.xml中添加以下依賴:io

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

也能夠在本地倉庫中手動安裝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>file

以上方法親自驗證過方法

相關文章
相關標籤/搜索