gluonfx-maven-plugin
gluonfx-maven-plugin copied to clipboard
When run with this plugin, `native-image` skips classes/packages it shouldn't skip
I am trying to compile a simple Clojure program with JavaFX and this client-maven-plugin. I know how to compile Clojure programs with native-image and have them work. But apparently, as soon as I use this plugin, native-image will skip a lot of packages it shouldn't skip. I tried for a few hours and am at my wit's end, so I'm assuming there is some kind of issue going on. This is my plugin config:
<plugin>
<groupId>com.gluonhq</groupId>
<artifactId>client-maven-plugin</artifactId>
<version>0.1.15</version>
<configuration>
<mainClass>${mainClassName}</mainClass>
<verbose>true</verbose>
<nativeImageArgs> -Dclojure.compiler.direct-linking=true -Dclojure.spec.skip-macros=true --initialize-at-build-time </nativeImageArgs>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
</plugin>
The three nativeImageArgs are what is required for Clojure programs to work with native-image, and they work fine when compiling independently. I also examined the generated classes.jar file (generated by client-maven-plugin from what I could figure out?) and it contains the classes/packages that are later omitted.
Can you try this?
<nativeImageArgs>
<list>-Dclojure.compiler.direct-linking=true</list>
<list>-Dclojure.spec.skip-macros=true</list>
<list>--initialize-at-build-time</list>
</nativeImageArgs>
@zilti did you manage to get it to work?