February 20, 2013 21:19:26Hits: 46090
When you use the M2eclipse plug-in, you need to rely on the Tools.jar of the Java runtime after you add the Struts2-core.jar package in Pom.xml. However, when Eclipse cannot read the tools package, the following error occurs:
Missing Artifact Com.sun:tools:jar 1.5.0
Solution One:
To manually configure Pom.xml, add a dependency as follows:
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<scope>system</scope>
<systempath>${java_home}/. /lib/tools.jar</systempath>
</dependency>
Can!
If the solution is not resolved, try the second method.
Solution Two:
First, look at the error List Windows->show View->problems, and the error will occur at the same time as the above problem.
The container ' Maven Dependencies ' references non existing library ' C:\Documents and settings\dell\.m2\repository\com\ Sun\tools\1.5.0\tools-1.5.0.jar '
Roughly speaking: Can't find the Tools-1.5.0.jar.
So copy the Tools.jar from the C:\Program files\java\jdk1.6.0_10\lib\ directory to the C:\Documents and settings\dell\.m2\repository\com\sun\ Tools\1.5.0\ directory, and rename Tools.jar to Tools-1.5.0.jar, and make the following configuration in Pom.xml:
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.5.0</version>
</dependency>
Can!
MORE: http://www.javaxxz.com/thread-72464-1-1.html
Solution Three:
Download jar to local C:\Users\Administrator\Desktop\, import into maven
CMD, enter:
MVN install:install-file-dgroupid=com.oracle-dartifactid=ojdbc14-dversion=10.2.0.2.0-dpackaging=jar-dfile=c:\ Users\administrator\desktop\ojdbc14-10.2.0.2.0.jar
Import into the MAVEN local library. Re-run the Maven update on OK.
Missing Artifact Com.sun:tools:jar 1.5.0