Skip to content

Instantly share code, notes, and snippets.

@shannah
Last active June 16, 2024 15:50
Show Gist options
  • Save shannah/bf41dc660ce81a9e2500ee08356e45ca to your computer and use it in GitHub Desktop.
Save shannah/bf41dc660ce81a9e2500ee08356e45ca to your computer and use it in GitHub Desktop.
Sample package.json for deploying Java app with jDeploy

Java App with JavaFX Deployment using jDeploy

This repository contains a Java application configured for deployment with jDeploy using JavaFX.

Getting Started

Follow the instructions below to deploy your JavaFX application:

  • Install the necessary dependencies
  • Build the project
  • Deploy the application using jDeploy

Dependencies

  • shelljs: ^0.8.4
  • njre: ^0.2.0

License

Your License

{
"bin": {"mysampleapp": "jdeploy-bundle/jdeploy.js"},
"author": "Your Name",
"description": "Description of your Java app for deployment with jDeploy",
"main": "index.js",
"preferGlobal": true,
"repository": "https://github.com/yourusername/yourrepo",
"version": "1.0.0",
"jdeploy": {
"jar": "target/yourapp-1.0.0.jar",
"javaVersion": "11",
"title": "YourAppTitle",
"javafx": true,
"jdk": false
},
"dependencies": {"shelljs": "^0.8.4", "njre": "^0.2.0"},
"license": "Your License",
"name": "jdeploy-demo-yourapp",
"files": ["jdeploy-bundle"],
"scripts": {"test": "echo \"Error: no test specified\" && exit 1"}
}
<!-- Add plugins for JavaFX support using maven-dependency-plugin and maven-jar-plugin -->
<build>
<plugins>
<!-- Add plugins for JavaFX support -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.2</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>your.main.class.Main</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment