launch4j-maven-plugin
launch4j-maven-plugin copied to clipboard
Build breaking in ARM linux environment
Build breaks in ARM linux environment. Trace below:
net.sf.launch4j.BuilderException: net.sf.launch4j.ExecException: Exec failed (126): /var/services/homes/user/.m2/repository/net/sf/launch4j/launch4j/3.11/launch4j-3.11-workdir-linux/bin/windres --preprocessor=cat -J rc -O coff -F pe-i386 /tmp/launch4j3613287198034571867rc /tmp/launch4j2006314587552851974o
at net.sf.launch4j.Builder.build(Builder.java:149)
at com.akathist.maven.plugins.launch4j.Launch4jMojo.execute(Launch4jMojo.java:403)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
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:498)
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: Exec failed (126): /var/services/homes/user/.m2/repository/net/sf/launch4j/launch4j/3.11/launch4j-3.11-workdir-linux/bin/windres --preprocessor=cat -J rc -O coff -F pe-i386 /tmp/launch4j3613287198034571867rc /tmp/launch4j2006314587552851974o
at net.sf.launch4j.Util.exec(Util.java:156)
at net.sf.launch4j.Cmd.exec(Builder.java:215)
at net.sf.launch4j.Builder.build(Builder.java:100)
... 23 more
... is there a workaround for this? A way to disable the plugin from the command line?
The simplest solution is to use a Maven profile and os.arch to activate given profile
https://stackoverflow.com/questions/6762271/how-to-use-platform-architecture-in-maven-to-determine-dependency
Lukasz, I have just built windres and ld binaries for ARM (with the kind support of Gottfried Haider, aka gohai). Can you incorporate these in the Launch4j Maven plugin as well as in the general Launch4j project? In the Maven plugin, you would still need some kind of switch according to the current platform.
I do not maintain the Launch4j project, please request such change directly here https://sourceforge.net/p/launch4j/bugs/ If the project will be extended, then I can update the plugin.
I provided a PR (https://github.com/mirror/launch4j/pull/4) in launch4j.
Without creating a ticket here your PR won't be visible to author of Launch4j - this is just a one way mirror in GH
Done: https://sourceforge.net/p/launch4j/bugs/213/
It seems, this issue is stalled. I have not exactly the same error, but I get the symptom is the same:
Execution failed for task ':createExe'.
> net.sf.launch4j.ExecException: Exec failed (2): /home/runner/work/pcgen/pcgen/build/tmp/launch4j/3.50/bin/windres --preprocessor=cat -J rc -O coff -F pe-i386 /tmp/launch4j10577460177212296881rc /tmp/launch4j885347231626909491o
I do use Gradle, and it seems that both repos (current and theirs) faced the same error: https://github.com/TheBoegl/gradle-launch4j/issues/90
As Launch4j seems to be abondened, there is an active fork https://codeberg.org/miurahr/launch4j & https://mvnrepository.com/artifact/org.omegat/launch4j , which has some issues fixed, ag ARM support. Maybe the plugin should switch to use it instead of the original Launch4j?
Hm... I can try to make the plugin to use different package and artifact name, should be doable 🤔
I talked to the author and all is fine, he's currently too busy to keep up with the project. Anyway, it should be possible to define the plugin in your pom.xml and just exclude net.sf.launch4j dependency and use the new artifact - that should work. I can make the artifact optional in the plugin (use <scope>optional</optional>) so when using the plugin you will have to provide a given implementation, either net.sf.launch4j or org.omegat.launch4j - yet this will be a breaking change for most of the users.