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.