2014-09-03 151 views
4

我需要从源代码构建Cloudstack,然后在文档中跟着this article。但是每次我用maven构建它时,都会遇到以下错误。猜测作为一种解决方案,我试着用oracle jdk-8,openjdk-7和openjdk6构建这个版本。并且还尝试了tomcat6和tomcat8。但没有解决。出了什么问题?我认为原因可能是一个插件的问题,但不知道如何解决。我在网上搜索这个错误,但没有解决方法。无法执行目标org.codehaus.mojo:exec-maven-plugin:1.2.1:exec

[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 

谢谢。

+0

你读过错误消息'进程退出出错:1(退出值:1)'? – khmarbaise 2014-09-03 14:32:15

+0

@khmarbaise是。但在这种情况下不知道。你能解释为什么和解决方案? – Deepal 2014-09-03 14:35:24

+1

4.2不是最新的稳定版本。你可以试试git checkout 4.3或4.4吗?同时检查java和javac版本。 4.3和1.7+应该是1.6 + 1.6 – 2014-09-04 04:51:23

回答

3

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

做一个git checkout到该版本分支,然后按照你提到的3210。

如果版本是X.Y.Z,分公司名称通常会是xy格式

开发人员指南是针对4.2编写的。您可能需要根据cloudstack版本调整Java软件包版本。

确保正确的Java版本做

java -versionjavac -version

的CloudStack安装需要Java 1.6至4.3和Java 1.7 4.4及以上

1

您应该使用4.2标记构建,因为您遵循了上述教程,我遇到了与该标记版本类似的问题,并最终升级到更高版本以解决该问题。

的CloudStack已经释放这应该解决你问题的4.4版本,所以你可能需要更新你的源代码,以该代码并重新构建应该没有问题的工作:

$ git fetch origin && git checkout -b 4.4.0 tags/4.4.0 
$ mvn clean install -Pdeveloper,systemvm 
相关问题