Could not get configured mojo for org.apache.maven.plugins:maven-checkstyle-plugin:2.17:checkstyle {execution: checkstyle}
Plugin org.apache.maven.plugins:maven-checkstyle-plugin:2.17 or one of its dependencies could not be resolved: Could not find artifact com.sun:tools:jar:1.7.0 at specified path D:\JAVA\JDK\jre7/../lib/tools.jar
解决方法一:
<!-- 避免出现 Could not find artifact com.sun:tools:jar:1.7.0问题 -->
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.5.0</version>
<scope>system</scope>
<systemPath>${java.home}/lib/tools.jar</systemPath>
</dependency>
本文介绍了解决Maven项目中使用Checkstyle插件时出现的'Couldnotfindartifactcom.sun:tools:jar:1.7.0'错误的方法。通过在pom.xml文件中正确配置com.sun:tools依赖项的路径,可以有效避免该问题。
1万+

被折叠的 条评论
为什么被折叠?



