Missingartifactcom. sun: tools: jar: 1.5.0 Solution

Source: Internet
Author: User

A while ago I got the latest Java EE version of eclipse. After importing the maven project, the pom file always reported Missing artifact com. sun: tools: jar: 1.5.0. Wondering, tools. jar is the jar package that comes with jdk. Check the pom dependency graph. It turns out that struts-core depends on this jar package.

I tried various methods on the Internet. The error is reported only when the jdk tools. jar is copied to the local repository.

The specific solution is as follows:

Copy the D: \ Program Files (x86) \ Java \ jdk1.6.0 _ 10 \ lib \ tools. jar file to the maven local repository and change its name. Change to tools-1.5.0.jar. Then write the pom file for the jar package:

<?xml version="1.0" encoding="UTF-8"?><project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">  <modelVersion>4.0.0</modelVersion>  <groupId>com.sun</groupId>  <artifactId>tools</artifactId>  <version>1.5.0</version></project>
Finally, add the corresponding maven dependency in the pom. xml file with the error:
<dependency><groupId>com.sun</groupId><artifactId>tools</artifactId><version>1.5.0</version></dependency>
In this way, the pom file will not report errors.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.