0

I have created a JavaFX application using NetBeans IDE and below is my folder structure.

Project Root Folder

dist I want to a build a single jar file including all dependencies for this jar to work properly. This jar requires testplanner and batch folder from project root directory and files inside dist folder to work properly. How can I package all this to a single jar file?

Dinesh
  • 639
  • 1
  • 6
  • 21

2 Answers2

1

Theoretically JAR files cannot contain dependencies within, as java does not support it out of the box. WAR and EAR archives can. What You want to do is not standard, but is named fat jar. Fat jars are used i.e. by spring-boot maven plugin, but you could try this: https://dzone.com/articles/how-build-fat-jar-using And some more explanation: NetBeans - deploying all in one jar

maslan
  • 2,078
  • 16
  • 34
0

Use tecreations Deploy. Put all your sources into a path declared as Tecreations.getProjectPath(), run BuildAll to create your corresponding classes, put your jars in projectpath/jars and select the appropriate settings, whether to include jars, sources or classes. Select your main class and click Deploy. Unsigned and signed output jars are produced in user/Documents.

Download: https://tecreations.ca/java/downloads/release.