Reputation: 1566
Is there a way to include all the dependencies WITHIN the generated jar by running the jfx:jar goal for the javafx maven plugin?
Currently, all the project dependencies are getting stored in a folder called 'lib'.
I'm looking for a way to generate the javafx executable jar like how the eclipse Project > Export > Runnable Jar settings have this option:
Some other info: Currently if I use the jfx:jar the generated jar is ~150kb and will not run unless the dependency libs are present.
However, if I use the eclipse runnable jar export option shown above, the generated jar is ~40,000kb and can run on its own.
My pom:
<properties>
<jfx.output.dir>${project.build.directory}/application/</jfx.output.dir>
</properties>
.
.
.
<plugins>
<plugin>
<groupId>com.zenjava</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>8.7.0</version>
<configuration>
<mainClass>my.main.class.Main</mainClass>
<jfxAppOutputDir>${jfx.output.dir}</jfxAppOutputDir>
<allPermissions>true</allPermissions>
</configuration>
</plugin>
</plugins>
Upvotes: 2
Views: 4723
Reputation: 1566
Been a while but I decided to answer this question.
I solved my problem by using another plugin which was not familiar to me as the question was posted.
Hope this helps others!
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>create-executable</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
<outputDirectory>${test.pack.dir}</outputDirectory>
<appendAssemblyId>false</appendAssemblyId>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>my.main.class.Main</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
Upvotes: 3
Reputation: 1
<plugins>
<plugin>
<groupId>com.zenjava</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>8.7.0</version>
<configuration>
<mainClass>my.main.class.Main</mainClass>
<jfxAppOutputDir>${jfx.output.dir}</jfxAppOutputDir>
<allPermissions>true</allPermissions>
</configuration>
</plugin>
</plugins>
This plugin doesnt help to bundle native packing in ubuntu .ie .deb file doesnt work. Java community should work on native bundling.
Upvotes: 0