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

"no modules specified" with CLASSPATH option

Open nils-christian opened this issue 4 years ago • 0 comments

Hi,

I have a Java 17 application without a module descriptor I would like to build with mvn javafx:jlink. I start the application usually within Eclipse by using --module-path --add-modules=javafx.controls. Now I tried to use the javafx maven plugin for this. This is my configuration:

<plugin>
	<groupId>org.openjfx</groupId>
	<artifactId>javafx-maven-plugin</artifactId>
	<version>0.0.8</version>
	<configuration>
		<mainClass>org.example.demo.Launcher</mainClass>
		<runtimePathOption>CLASSPATH</runtimePathOption>
	</configuration>
</plugin>

I can start my application with mvn javafx:run, but I cannot use jlink. I get the error message

[INFO] --- javafx-maven-plugin:0.0.8:jlink (default-cli) @ demo ---
Error: no modules specified to --add-modules
Usage: jlink <options> --module-path <modulepath> --add-modules <module>[,<module>...]
Use --help for a list of possible options

Am I missing something or is it just not possible to use javafx:jlink without module descriptor? If so, the runtimePathOption CLASSPATH should probably not be allowed for the jlink execution.

Thank you and best regards

Nils

nils-christian avatar Oct 30 '21 12:10 nils-christian