我正在命令提示符下使用
mvn clean
命令,但构建失败。
Downloading:
https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-
plugin/2.5/maven-clean-plugin-2.5.pom
[INFO] Reactor Summary:
[INFO] ABC ......................................... FAILURE [ 2.226 s]
[INFO] BUILD FAILURE
[INFO] Total time: 3.098 s
[INFO] Finished at: 2018-11-16T15:10:36+05:30
[INFO] Final Memory: 12M/153M
[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] 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
但是当我从 Eclipse 内部使用
mvn clean
命令时,它正在成功构建。
[INFO] ---------------------------------------------------------------------
---
Downloading:
http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-
plugin/2.4.1/maven-clean-plugin-2.4.1.pom
Downloaded:
http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-
plugin/2.4.1/maven-clean-plugin-2.4.1.pom (5 KB at 5.2 KB/sec)
-------------------------
[INFO] BUILD SUCCESS
[INFO] Total time: 4.387s
我能看到的区别是,在命令提示符下它尝试下载 maven-clean-plugin-2.5,而从 eclipse 中它成功下载 2.4.1
但我只需要运行2.5。 谁可以帮我这个事。 谢谢。
我不知道你是否全局安装了maven。你可以尝试全局安装maven。请按照步骤操作。
创建或导出 M2_HOME="MAVEN ROOT LOCATION"。前任。 : E:\SoftwareRepo 构建工具 pache-maven-3.5.2
创建或导出 MAVEN bin 文件夹位置到 PATH 变量。例如:E:\SoftwareRepo 中的 pache-maven-3.5.2 工具
打开终端或cmd并运行您可以像使用 Eclipse 一样使用它。 然后去日食。并设置项目。按照以下步骤操作
导入已有的maven项目或创建maven项目