gluonfx-maven-plugin icon indicating copy to clipboard operation
gluonfx-maven-plugin copied to clipboard

When run with this plugin, `native-image` skips classes/packages it shouldn't skip

Open zilti opened this issue 5 years ago • 2 comments

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.

zilti avatar Feb 01 '20 10:02 zilti

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>

lazar-mitrovic avatar Feb 29 '20 19:02 lazar-mitrovic

@zilti did you manage to get it to work?

Futurile avatar May 11 '20 08:05 Futurile