2014-09-03 38 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 
相關問題