java - 无法执行目标 org.codehaus.mojo :exec-maven-plugin:1. 2.1:exec

标签 java maven apache-cloudstack

我需要从源代码构建 Cloudstack 并遵循 this article在文档中。但是每次我用 maven 构建它时,我都会遇到以下错误。猜测作为解决方案,我用 oracle jdk-8、openjdk-7 和 openjdk6 尝试了这个构建。并且还尝试了tomcat6和tomcat8。但是没有解决办法。出了什么问题?我认为原因可能是插件的问题,但不知道如何解决。我在网上搜索了这个错误,但没有找到解决方法。

[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (compile) on project cloud-apidoc: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (compile) on project cloud-apidoc: Command execution failed.
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Command execution failed.
    at org.codehaus.mojo.exec.ExecMojo.execute(ExecMojo.java:362)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
    ... 19 more
Caused by: org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
    at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:377)
    at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:160)
    at org.codehaus.mojo.exec.ExecMojo.executeCommandLine(ExecMojo.java:610)
    at org.codehaus.mojo.exec.ExecMojo.execute(ExecMojo.java:352)
    ... 21 more
[ERROR] 
[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/MojoExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :cloud-apidoc

谢谢。

最佳答案

最新版本的cloudstack可以从cloudstack downloads找到页面

对该版本分支执行 git checkout,然后遵循 developer guide你提到过。

如果版本是 x.y.z,分支名称通常是 x.y

开发者指南是专门为 4.2 编写的。您可能需要根据 cloudstack 版本调整 java 包版本。

确保安装了正确的 java 版本

java -versionjavac -version

cloudstack 需要 java 1.6 到 4.3,4.4 及以上需要 java 1.7

关于java - 无法执行目标 org.codehaus.mojo :exec-maven-plugin:1. 2.1:exec,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25646091/

相关文章:

java - 在任何类型的括号内用下划线替换破折号

java - OOP扩展继承问题

java - 何时需要以及何时不需要手动将更新保存到 JPA 实体

java - 使用树集优于手动排序集的好处

hadoop - 如何部署Spark,使其可以最大程度地利用资源

java - 不同环境使用不同的 WSDL

git - jenkins Nexus Artifact uploader 400

java - Spring boot 找不到 PropertySource : label not found

mysql - 如何在 RHEL 7.4 上安装 cloudstack

vmware - 不使用 vCenter 的 Cloudstack