orphan-oss/launch4j-maven-plugin

Plugin fails with Java 16

martinpaljak opened this issue · 7 comments

JDK 15 was still working, trying with 16 fails with:

[ERROR] Failed to execute goal com.akathist.maven.plugins.launch4j:launch4j-maven-plugin:1.7.25:launch4j (apdu4j-exe) on project apdu4j-tool: Execution apdu4j-exe of goal com.akathist.maven.plugins.launch4j:launch4j-maven-plugin:1.7.25:launch4j failed: An API incompatibility was encountered while executing com.akathist.maven.plugins.launch4j:launch4j-maven-plugin:1.7.25:launch4j: java.lang.ExceptionInInitializerError: null
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>com.akathist.maven.plugins.launch4j:launch4j-maven-plugin:1.7.25
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/home/martin/.m2/repository/com/akathist/maven/plugins/launch4j/launch4j-maven-plugin/1.7.25/launch4j-maven-plugin-1.7.25.jar
[ERROR] urls[1] = file:/home/martin/.m2/repository/net/sf/launch4j/launch4j/3.12/launch4j-3.12-core.jar
[ERROR] urls[2] = file:/home/martin/.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar
[ERROR] urls[3] = file:/home/martin/.m2/repository/commons-logging/commons-logging/1.2/commons-logging-1.2.jar
[ERROR] urls[4] = file:/home/martin/.m2/repository/foxtrot/foxtrot/2.0/foxtrot-2.0.jar
[ERROR] urls[5] = file:/home/martin/.m2/repository/com/jgoodies/jgoodies-common/1.7.0/jgoodies-common-1.7.0.jar
[ERROR] urls[6] = file:/home/martin/.m2/repository/com/jgoodies/forms/1.2.1/forms-1.2.1.jar
[ERROR] urls[7] = file:/home/martin/.m2/repository/com/jgoodies/looks/2.2.2/looks-2.2.2.jar
[ERROR] urls[8] = file:/home/martin/.m2/repository/com/thoughtworks/xstream/xstream/1.4.8/xstream-1.4.8.jar
[ERROR] urls[9] = file:/home/martin/.m2/repository/xmlpull/xmlpull/1.1.3.1/xmlpull-1.1.3.1.jar
[ERROR] urls[10] = file:/home/martin/.m2/repository/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar
[ERROR] urls[11] = file:/home/martin/.m2/repository/org/apache/ant/ant/1.8.2/ant-1.8.2.jar
[ERROR] urls[12] = file:/home/martin/.m2/repository/org/apache/ant/ant-launcher/1.8.2/ant-launcher-1.8.2.jar
[ERROR] urls[13] = file:/home/martin/.m2/repository/javax/enterprise/cdi-api/1.0/cdi-api-1.0.jar
[ERROR] urls[14] = file:/home/martin/.m2/repository/org/eclipse/sisu/org.eclipse.sisu.inject/0.3.3/org.eclipse.sisu.inject-0.3.3.jar
[ERROR] urls[15] = file:/home/martin/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
[ERROR] urls[16] = file:/home/martin/.m2/repository/org/codehaus/plexus/plexus-utils/3.1.0/plexus-utils-3.1.0.jar
[ERROR] urls[17] = file:/home/martin/.m2/repository/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.jar
[ERROR] urls[18] = file:/home/martin/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.11/plexus-interpolation-1.11.jar
[ERROR] urls[19] = file:/home/martin/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[project>com.github.martinpaljak:apdu4j:20.08.14-SNAPSHOT, parent: ClassRealm[maven.api, parent: null]]]
[ERROR] 
[ERROR] -----------------------------------------------------
[ERROR] : Unable to make field private final java.util.Comparator java.util.TreeMap.comparator accessible: module java.base does not "opens java.util" to unnamed module @2c6062bd
[ERROR] -> [Help 1]
[ERROR] 

(can try with https://github.com/martinpaljak/apdu4j/tree/jdk11-modules and specifically https://github.com/martinpaljak/apdu4j/runs/2128376087?check_suite_focus=true)

I just pushed a new version of the plugin which uses Launch4j 3.14 (the latest one) and also switched to Java 8 as a minimal supported versions. Could you test this version once it will be available in Maven Central?
https://github.com/lukaszlenart/launch4j-maven-plugin#version-notes-200---2021-03-17

Tried the 2.0.0 version with 3.14 launch4j and got (with Java 16)t:

Caused by: java.lang.NullPointerException: Cannot invoke "java.io.File.getParentFile()" because "platJar" is null
    at com.akathist.maven.plugins.launch4j.Launch4jMojo.unpackWorkDir (Launch4jMojo.java:488)
    at com.akathist.maven.plugins.launch4j.Launch4jMojo.setupBuildEnvironment (Launch4jMojo.java:479)
    at com.akathist.maven.plugins.launch4j.Launch4jMojo.doExecute (Launch4jMojo.java:333)
    at com.akathist.maven.plugins.launch4j.Launch4jMojo.execute (Launch4jMojo.java:328)

2.0.0 With 11:

Caused by: java.lang.NullPointerException
    at com.akathist.maven.plugins.launch4j.Launch4jMojo.unpackWorkDir (Launch4jMojo.java:488)
    at com.akathist.maven.plugins.launch4j.Launch4jMojo.setupBuildEnvironment (Launch4jMojo.java:479)
    at com.akathist.maven.plugins.launch4j.Launch4jMojo.doExecute (Launch4jMojo.java:333)
    at com.akathist.maven.plugins.launch4j.Launch4jMojo.execute (Launch4jMojo.java:328)

1.7.25 with 11: all good
1.7.25 with 16: as OP

Interesting :)

This code is there unchanged from initial import :) Looks like some Maven plugins related change

Could you try to use 2.0.1?

2.0.1 seems to work a-ok.