我有一个需要进行的Maven项目。我安装了Eclipse SE(Mars 2,因为我需要在JDK 1.7上工作),并且只是试图将项目导入为an existing Maven project,但是在Eclipse中出现此错误:我从这里下载了maven 3.5.4并将其添加bin到了我的路径。现在,我尝试mvn clean从项目文件夹中的命令行执行此错误:[INFO] --------------------------------[ jar ]---------------------------------Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom[INFO] ------------------------------------------------------------------------[INFO] BUILD FAILURE[INFO] ------------------------------------------------------------------------[INFO] Total time: 0.792 s[INFO] Finished at: 2018-06-26T09:42:32-05:00[INFO] ------------------------------------------------------------------------[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 central (https://repo.maven.apache.org/maven2): Received fatal alert: protocol_version -> [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看来这是一个很普遍的错误,但我还不能解决。怎么解决呢?我看不到settings.xml我的.m2文件夹中。
2 回答
![?](http://img1.sycdn.imooc.com/533e50ed0001cc5b02000200-100-100.jpg)
慕尼黑的夜晚无繁华
TA贡献1864条经验 获得超6个赞
如果在.m2文件夹中看不到setting.xml,则可以手动创建文件,并且需要将文件显式放置在该位置。放置文件后,用于Eclipse的maven插件也将开始使用该文件。
您要做的另一件事是尝试将项目移至其他位置。例如:c:\ users \ <> \ Workspace \ Project \到E:\ Workspace \ Project \看起来很奇怪,但有时此解决方案可行。
添加回答
举报
0/150
提交
取消