MAVEN报错:Missing artifact com.sun:tools:jar:1.5.0:解决方法

来源:互联网 发布:linux故障排查 编辑:程序博客网 时间:2024/05/16 17:50
导入已经开发完成的maven项目发现的如下错误:
  Missing artifact com.sun:tools:jar:1.5.0:system
  找不到tools.jar这个是在环境变量classpath中配置的,同时POM.xml文件上方显示有错,于是乎开始查到是不是环境配置的问题,百思不得其解,从网上搜了一下找到了正确的答案:
描述:Pom.xml文件中最上方有错,提示Missing artifact com.sun:tools:jar:1.5.0:system

解决:修改pom.xml文件

<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>${struts.version}</version>
<type>jar</type>
<scope>compile</scope>
<exclusions>
<exclusion>
<artifactId>tools</artifactId>
<groupId>com.sun</groupId>
</exclusion>
</exclusions>

</dependency>

0 0