Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Launch4J 3.50 #199

Closed
ianrenton opened this issue Nov 17, 2022 · 12 comments · Fixed by #200
Closed

Update to Launch4J 3.50 #199

ianrenton opened this issue Nov 17, 2022 · 12 comments · Fixed by #200

Comments

@ianrenton
Copy link

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.

@lukaszlenart
Copy link
Collaborator

Yeah, on my plate and I'll be working on it next week

@ianrenton
Copy link
Author

Brilliant, thank you!

lukaszlenart added a commit that referenced this issue Nov 19, 2022
@lukaszlenart
Copy link
Collaborator

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

@ianrenton
Copy link
Author

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.

@ianrenton
Copy link
Author

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.

@lukaszlenart
Copy link
Collaborator

What version of Maven do you use?

@ianrenton
Copy link
Author

I am using Maven 3.8.6. I am building on Windows 10 Pro 21H1 64-bit, using Adoptium OpenJDK 17.0.4.1.

@lukaszlenart
Copy link
Collaborator

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.

@lukaszlenart
Copy link
Collaborator

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>

@ianrenton
Copy link
Author

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.

@lukaszlenart
Copy link
Collaborator

Ah... that makes sense, thanks for taking time and testing the new version, so let the merge & release party begins 🎉

@ianrenton
Copy link
Author

Great, thank you for releasing an update so quickly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants