在eclipse中执行clean package指令报错,错误信息如下:
[INFO] Scanning for projects...
[INFO]
[INFO] --------------------------< com.demo:ws-demo >--------------------------
[INFO] Building ws-demo 0.0.1-SNAPSHOT
[INFO] -------------------------------[ bundle ]-------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.668 s
[INFO] Finished at: 2019-07-25T16:04:20+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:3.1.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:3.1.0: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:3.1.0 from/to public (http://******************.com/nexus/content/groups/public/): Cannot access http://******************.com/nexus/content/groups/public/ with type default using the available connector factories: BasicRepositoryConnectorFactory: Cannot access http://******************.com/nexus/content/groups/public/ using the registered transporter factories: WagonTransporterFactory: java.util.NoSuchElementException
[ERROR] role: org.apache.maven.wagon.Wagon
[ERROR] roleHint: http
[ERROR] -> [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
网上有很多解决办法,分别如下:
- 由于maven默认的下载服务器在国外,网络不好下载不好jar包,让修改maven_home/conf目录下的setting文件,增加阿里的下载镜像地址,然后重新下载插件;
- 删除插件在本地仓库中的目录,重新下载,不停的尝试,直到可行为止
- 等等等。。。。。。
小编在尝试上面的两种方式之后,最终的解决办法:
在cmd窗口进入到项目目录下,执行指令mvn clean package,然后就BUILD SUCCESS,试100次成功100次,回头再到eclipse中执行,也BUILD SUCCESS了
个种原因我就不是很清楚,只是不再相信eclipse的这些插件了。还是老老实实在cmd窗口敲命令