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

javafx:jlink if no configuration 'workingDirectory' java.lang.NullPointerException occurred

Open topsoft-support opened this issue 4 years ago • 3 comments

<plugin>
                <groupId>org.openjfx</groupId>
                <artifactId>javafx-maven-plugin</artifactId>
                <version>0.0.4</version>
                <configuration>
                    <stripDebug>false</stripDebug>
                    <compress>2</compress>
                    <noHeaderFiles>true</noHeaderFiles>
                    <noManPages>true</noManPages>
                    <launcher>hellofx</launcher>
                    <jlinkImageName>hello</jlinkImageName>
                    <jlinkZipName>hellozip</jlinkZipName>
                    <mainClass>org.openjfx.App</mainClass>
<!--                    <workingDirectory>${project.basedir}</workingDirectory>--> <!-- if no configuration >
                </configuration>
                <executions>
                    <execution>
                        <id>run</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>jlink</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>jlink</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

console:

Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal org.openjfx:javafx-maven-plugin:0.0.4:jlink failed.
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
	... 21 more
Caused by: java.lang.NullPointerException
	at org.openjfx.JavaFXBaseMojo.getExecutablePath(JavaFXBaseMojo.java:368)
	at org.openjfx.JavaFXJLinkMojo.execute(JavaFXJLinkMojo.java:154)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
	... 22 more

but! javafx:run work fine.

topsoft-support avatar Aug 15 '20 07:08 topsoft-support

I have the same problem, what kind of path to write inside of it? Also, if you transfer the zip launcher file to another pc the launcher will still run?

YovelB avatar Sep 17 '20 16:09 YovelB

Same problem here. Works fine with javafx:run too

Yolepo avatar Oct 08 '20 13:10 Yolepo

I can also confirm this, I followed the example code here: https://github.com/openjfx/samples/blob/master/CommandLine/Modular/Maven/hellofx/pom.xml (which uses version 0.0.3 of the plugin), when I updated it to 0.0.4 the jlink goal threw the same NPE as above. Adding the workingDirectory fixed it.

Dr4K4n avatar Oct 10 '20 23:10 Dr4K4n