【发布时间】:2018-11-22 06:39:36
【问题描述】:
我继承了一个孤立的 Java 8/Maven 项目,并正在尝试构建。在自述文件中,我看到了运行以下命令的说明:
mvn -o -q -Dexec.executable="echo" -Dexec.args='${project.version}' org.codehaus.mojo:exec-maven-plugin:exec
当我从项目根目录(包含pom.xml)运行该文件时,我收到此错误:
[ERROR] Error resolving version for plugin 'org.codehaus.mojo:exec-maven-plugin' from the repositories [local (/Users/myuser/.m2/repository), central (https://repo.maven.apache.org/maven2)]: Plugin not found in any plugin repository -> [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/PluginVersionResolutionException
看起来它正在尝试使用this plugin 通过echo 打印project.version。
我想知道我需要做什么才能使其正常工作,听起来 Maven 在其配置为查看的任何存储库中都找不到 org.codehaus.mojo:exec-maven-plugin,但我不知道是否:
- 我需要向我的
pom.xml添加另一个存储库配置;或 - 我需要在本地+手动安装
org.codehaus.mojo:exec-maven-plugin,以便Maven可以找到并执行它;或 - 发生了其他事情
有什么想法吗?!
【问题讨论】:
标签: java maven maven-plugin