Update to Launch4J 3.50
ianrenton opened this issue ยท 12 comments
Launch4J 3.50 has recently been released, which improves support for finding preinstalled and bundled JREs. I have had issues with Launch4J executables not finding OpenJDK 17 runtimes in some corporate IT setups, and the new version of Launch4J looks like it could improve this situation.
It does include some changes to the names of configuration properties, which I don't believe will impact launch4j-maven-plugin directly, though it will impact users of it who would have to update their POMs accordingly.
Yeah, on my plate and I'll be working on it next week
Brilliant, thank you!
Version 2.2.0-SNAPSHOT has been deployed to https://oss.sonatype.org/content/repositories/snapshots/ - you can test it before I will merge the PR - there are some configurations changes required
I was perhaps a bit optimistic when I said the upgrade "shouldn't affect launch4j-maven-plugin directly" - I forgot that of course you would have to replicate all the parameter changes in the Mojo.
I will give the new snapshot a try, thank you.
I've tried the new snapshot and had some dependency issues. I'm not sure if these are "real" or just a problem with my setup. When swapping 2.1.2 for 2.2.0-SNAPSHOT and updating my Launch4J config accordingly, I got the following:
Execution l4j of goal com.akathist.maven.plugins.launch4j:launch4j-maven-plugin:2.2.0-SNAPSHOT:launch4j failed: A required class was missing while executing com.akathist.maven.plugins.launch4j:launch4j-maven-plugin:2.2.0-SNAPSHOT:launch4j: net/sf/launch4j/config/ConfigPersisterException
I manually added net.sf.launch4j:launch4j:3.50:core as a dependency of launch4j-maven-plugin in my POM to get past this, then hit another similar problem:
Execution l4j of goal com.akathist.maven.plugins.launch4j:launch4j-maven-plugin:2.2.0-SNAPSHOT:launch4j failed: A required class was missing while executing com.akathist.maven.plugins.launch4j:launch4j-maven-plugin:2.2.0-SNAPSHOT:launch4j: org/apache/maven/shared/transfer/artifact/resolve/ArtifactResolverException
I found this class in org.apache.maven.shared:maven-artifact-transfer and added that as a dependency of the plugin as well.
After adding both of these dependencies, it now works for me.
What version of Maven do you use?
I am using Maven 3.8.6. I am building on Windows 10 Pro 21H1 64-bit, using Adoptium OpenJDK 17.0.4.1.
I have tested the change using this project (even using maven:3.8-openjdk-8
Docker image) and everything is fine when running on the latest Maven version.
One thing, you must add such section to your pom.xml
<pluginRepositories>
<pluginRepository>
<id>oss-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<layout>default</layout>
<name>OSS Sonatype Snapshots</name>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
Thanks. I am actually building the software on a network with no internet access, with JARs manually downloaded and transferred to our internal Artifactory server - as you can imagine, this weird setup is why I suspected the dependency problem is at my end rather than with the plug-in itself! In all other respects it is working for me.
Ah... that makes sense, thanks for taking time and testing the new version, so let the merge & release party begins ๐
Great, thank you for releasing an update so quickly!