gluonhq / gluonfx-maven-plugin

Plugin that simplifies creating native images for Java/JavaFX maven projects
BSD 3-Clause "New" or "Revised" License
189 stars 39 forks source link

run and runagent do not add runtimeArgs #431

Closed ennerf closed 2 years ago

ennerf commented 2 years ago

I'm using a dependency that requires some runtime arguments, e.g.,

<runtimeArgs>
    <arg>--add-opens=javafx.controls/com.sun.javafx.scene.control.inputmap=ALL-UNNAMED</arg>
    <arg>--add-opens=javafx.controls/com.sun.javafx.scene.control.behavior=ALL-UNNAMED</arg>
    <arg>--add-opens=javafx.graphics/javafx.css=ALL-UNNAMED</arg>
    <arg>--add-opens=javafx.graphics/com.sun.javafx.css=ALL-UNNAMED</arg>
    <arg>--add-opens=javafx.graphics/com.sun.javafx.scene.traversal=ALL-UNNAMED</arg>
</runtimeArgs>

The native image adds the arguments and works, but both run and runagent fail due to access errors. I haven't tried macOS, but run fails on both Linux and Windows.

Khithar commented 2 years ago

how about this ?

<plugin>
    <groupId>org.openjfx</groupId>
        <artifactId>javafx-maven-plugin</artifactId>
            <version>${javafx.plugin.version}</version>
        <configuration>
                    <mainClass>${main.class}</mainClass>
                    <options>
                        <option>--add-opens</option>
                        <option>javafx.controls/com.sun.javafx.scene.control.inputmap=ALL-UNNAMED</option>
                        <option>--add-opens</option>
                        <option>javafx.controls/com.sun.javafx.scene.control.behavior=ALL-UNNAMED</option>
                        ....
                    </options>
                </configuration>
</plugin>
ennerf commented 2 years ago

That works. I didn't realize that the gluonfx-maven-plugin defers run to the javafx-maven-plugin. Thanks.