[ERROR] Failed to execute goal org.apache.maven.plugins:maven-source-plugin:2.4:jar (attach-sources) on project DIM-Core: Execution attach-sources of goal org.apache.maven.plugins:maven-source-plugin:2.4:jar failed: Plugin org.apache.maven.plugins:maven-source-plugin:2.4 or one of its dependencies could not be resolved: The following artifacts could not be resolved: org.apache.maven:maven-project:jar:2.2.1, org.apache.maven:maven-artifact-manager:jar:2.2.1: Failure to find org.apache.maven:maven-project:jar:2.2.1 in http://172.21.20.25:8081/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :DIM-Core
<plugins>
<!-- source attach plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>百度了一圈,各种错误原因都试了。
jdk版本对应,环境变量配置正常。

解决方案 »

  1.   

    DIM项目的maven-source-plugin:2.4:jar 加载出错
    应该是环境问题,先确认可以链接上maven服务,能够下载需要的包;
    再JDK版本对应确认同步<java.version>1.8</java.version>
     项目的JDK、workspace的JDK、pom.xml中配置的JDK
    然后各种clean,关掉工具再打开,试试
      

  2.   

    有人吗。。本地有maven-source-plugin,版本号没错。JDK也没错
    一直无法解决这个问题