karamelchef / karamel

Reproducing Distributed Systems and Experiments on Cloud
http://www.karamel.io
Apache License 2.0
39 stars 22 forks source link

Error during Maven build #89

Closed marcbux closed 9 years ago

marcbux commented 9 years ago

I get the following error when running mvn package:

[ERROR] Failed to execute goal com.akathist.maven.plugins.launch4j:launch4j-maven-plugin:1.7.7:launch4j (l4j-clui) on project karamel-ui: Failed to build the executable; please verify your configuration. net.sf.launch4j.ExecException: java.io.IOException: Cannot run program "/home/hiway/.m2/repository/net/sf/launch4j/launch4j/3.8.0/launch4j-3.8.0-workdir-linux/bin/windres": error=2, No such file or directory -> [Help 1]

marcbux commented 9 years ago

It looks like maven didn't download the launch4j plugin. Launch4j is only needed to build the windows .exe version. It's a maven plugin that's run in the package phase. Unfortunately, when running maven clean install, I run into the same error.

marcbux commented 9 years ago

This issue should be reproducible fairly easy. On a fresh Ubuntu 14.04 VM, just run

sudo apt-get install -y maven git git clone https://github.com/karamelchef/karamel.git cd karamel mvn install

jimdowling commented 9 years ago

Ok, i checked this out and think I fixed it. I had a dependency on a repo and replaced it with a maven dependency. I pushed it straight to the master and I did a new release to karamel.io. Let me know if it's still a problem.

marcbux commented 9 years ago

Unfortunately, it still doesn't work for me. This is the error mesage in more detail:

[ERROR] net.sf.launch4j.BuilderException: net.sf.launch4j.ExecException: java.io.IOException: Cannot run program "/home/hiway/.m2/repository/net/sf/launch4j/launch4j/3.8.0/launch4j-3.8.0-workdir-linux/bin/windres": error=2, No such file or directory at net.sf.launch4j.Builder.build(Builder.java:146) at com.akathist.maven.plugins.launch4j.Launch4jMojo.execute(Launch4jMojo.java:336) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209) 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:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) 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: net.sf.launch4j.ExecException: java.io.IOException: Cannot run program "/home/hiway/.m2/repository/net/sf/launch4j/launch4j/3.8.0/launch4j-3.8.0-workdir-linux/bin/windres": error=2, No such file or directory at net.sf.launch4j.Util.exec(Util.java:160) at net.sf.launch4j.Cmd.exec(Builder.java:212) at net.sf.launch4j.Builder.build(Builder.java:96) ... 22 more Caused by: java.io.IOException: Cannot run program "/home/hiway/.m2/repository/net/sf/launch4j/launch4j/3.8.0/launch4j-3.8.0-workdir-linux/bin/windres": error=2, No such file or directory at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047) at java.lang.Runtime.exec(Runtime.java:617) at java.lang.Runtime.exec(Runtime.java:485) at net.sf.launch4j.Util.exec(Util.java:128) ... 24 more Caused by: java.io.IOException: error=2, No such file or directory at java.lang.UNIXProcess.forkAndExec(Native Method) at java.lang.UNIXProcess.(UNIXProcess.java:186) at java.lang.ProcessImpl.start(ProcessImpl.java:130) at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028) ... 27 more [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] karamel-parent .................................... SUCCESS [5.266s] [INFO] karamel-core ...................................... SUCCESS [26.395s] [INFO] karamel-ui ........................................ FAILURE [15.641s] [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 47.881s [INFO] Finished at: Fri Jul 24 10:11:02 CEST 2015 [INFO] Final Memory: 65M/479M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal com.akathist.maven.plugins.launch4j:launch4j-maven-plugin:1.7.7:launch4j (l4j-clui) on project karamel-ui: Failed to build the executable; please verify your configuration. net.sf.launch4j.ExecException: java.io.IOException: Cannot run program "/home/hiway/.m2/repository/net/sf/launch4j/launch4j/3.8.0/launch4j-3.8.0-workdir-linux/bin/windres": error=2, No such file or directory -> [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/MojoExecutionException [ERROR] [ERROR] After correcting the problems, you can resume the build with the command [ERROR] mvn -rf :karamel-ui

jimdowling commented 9 years ago

I have tried to replicate this without any success. I added another dependency, but I am not sure if this will work. Does the path /home/hiway/.m2/repository/net/sf/launch4j/launch4j/3.8.0/ exist? Does the file exist: /home/hiway/.m2/repository/net/sf/launch4j/launch4j/3.8.0/launch4j-3.8.0-workdir-linux/bin/windres

I added explicitly the dependency to this package, although it should have been pulled down as a transative dependency.

This is low priority for me. You can still just use wget for the jar files. Worst case, fork the repo and remove the launch4j plugin from karamel-ui/pom.xml .

jimdowling commented 9 years ago

I understand what the problem is now. It's because launch4j plugin uses 32-bit binaries to build itself: http://sourceforge.net/p/launch4j/feature-requests/74/ I changed the pom.xml to put the launch4j plugin into the -Dwin profile. I updated the README.md to explain the convoluted way to build on Ubuntu.

marcbux commented 9 years ago

Thanks, it works smoothly now!