[英]Maven can't find org.codehaus.mojo:exec-maven-plugin at command line
I inherited an orphaned Java 8/Maven project and am trying to figure the build out. 我继承了一个孤立的Java 8 / Maven项目,并试图确定其构建方式。 In the README I see instructions to run the following command: 在自述文件中,我看到了运行以下命令的说明:
mvn -o -q -Dexec.executable="echo" -Dexec.args='${project.version}' org.codehaus.mojo:exec-maven-plugin:exec
When I run that form my project root (which contains pom.xml
) I get this error: 当我从我的项目根目录(包含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
Looks like it's trying to use this plugin to print the project.version
via echo
. 看起来它正在尝试使用此插件通过echo
打印project.version
。
I'm wondering what I need to do so that this works, it sounds like Maven just can't find org.codehaus.mojo:exec-maven-plugin
in any of the repos its been configured to look in, but I can't tell whether: 我想知道我需要做些什么才能使它工作,听起来Maven只是无法在配置为查找的任何存储库中找到org.codehaus.mojo:exec-maven-plugin
,但是我可以不知道是否:
pom.xml
; 我需要在pom.xml
添加另一个存储库配置; or 要么 org.codehaus.mojo:exec-maven-plugin
somewhere locally + manually so that Maven can find it and execute it; 我需要在本地+手动安装org.codehaus.mojo:exec-maven-plugin
以便Maven可以找到并执行它; or 要么 Any ideas?! 有任何想法吗?!
You specify -o
as argument to Maven. 您将-o
指定为Maven的参数。 It means "offline". 它的意思是“离线”。 With it you will not be able to download the dependency. 有了它,您将无法下载依赖项。
Note also that you could specify the version of the plugin to ensure that the plugin be downloaded because your actual errors says : 还请注意,您可以指定插件的版本以确保下载插件,因为您的实际错误是:
Error resolving version for plugin 插件的错误解决版本
The version is not required to run a standalone goal but you don't invoke a standalone goal. 该版本不是运行独立目标所必需的,但是您不会调用独立目标。
So try something like : 因此,尝试类似:
mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}'
org.codehaus.mojo:exec-maven-plugin:1.6.0:exec
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.