执行 mvn clean test时报错

第一次执行mvn clean test测试指令,发现无法如下的报错:

[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to alimaven (http://maven.aliyun.com/nexus/content/groups/public/): /usr/local/software/apache-maven-3.6.3/maven-repository/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom.part.lock (No such file or directory) -> [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
Build step 'Invoke top-level Maven targets' marked build as failure

解决问题如下:

  1.检查Linux服务器maven本地仓库中是否有下载成功的插件内容。如果没有,可能是本地仓库文件夹Jenkins没有写入的权限,使用chmod 777 filename 指令可以解决。

原文地址:https://www.cnblogs.com/zhap/p/15427097.html