4

I needed to build Cloudstack from source and followed this article in the documentation. But everytime I built it with maven, I got stuck with following error. Guessing as a solution, I tried this build with oracle jdk-8, openjdk-7 and openjdk6. And also tried tomcat6 and tomcat8. But got no solution. What is going wrong? I think the reason could be a problem with a plugin but have no idea how to solve. I searched online for this error, but got no workaround.

[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

Thank you.

Deepal
  • 1,729
  • 5
  • 24
  • 34
  • Have you read the error message ` Process exited with an error: 1 (Exit value: 1)`? – khmarbaise Sep 03 '14 at 14:32
  • @khmarbaise Yup. But have no idea in this case. Can you explain why and a solution? – Deepal Sep 03 '14 at 14:35
  • 1
    4.2 isnt the latest stable release. can you try git checkout 4.3 or 4.4? Also check the java and javac version. it should be 1.6+ for 4.3 and 1.7+ for 4.4 – Rajani Karuturi Sep 04 '14 at 04:51
  • @RajaniKaruturi I have installed checked with both java 1.6 and 1.8. But results was the same. I'll try 4.3 as well. Thank you. – Deepal Sep 04 '14 at 06:07
  • 1
    I havent tried 1.8 but, it works on 1.6. before you build, make sure java -version and javac -version both show 1.6 – Rajani Karuturi Sep 04 '14 at 08:17
  • @RajaniKaruturi Thanks for your help. I tried with 4.3 as you mentioned and working as a charm. If you can add it below as an answer I can mark it as accepted. – Deepal Sep 04 '14 at 20:28

2 Answers2

3

The latest version of cloudstack can be found from cloudstack downloads page

Do a git checkout to that version branch and then follow the developer guide you mentioned.

If version is x.y.z, the branch name would usually be x.y

The developer guide is specifically written for 4.2. You may have to adjust the java packages version according to cloudstack version.

make sure the right java versions are installed by doing

java -version and javac -version

cloudstack requires java 1.6 till 4.3 and java 1.7 for 4.4 and above

Rajani Karuturi
  • 3,450
  • 3
  • 27
  • 40
1

You should be using the 4.2 tag build since you followed the mentioned tutorial, I have run into a similar issue with that tag version and ended up upgrading to an onward version to resolve the case.

CloudStack has already release the 4.4 version which should resolve you problem, so you may need to update your sources to that tag and retry you build which should work without problems:

$ git fetch origin && git checkout -b 4.4.0 tags/4.4.0
$ mvn clean install -Pdeveloper,systemvm
tmarwen
  • 15,750
  • 5
  • 43
  • 62