-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
configured gradle and java to be able to create a working fat jar
- Loading branch information
Ksawery Chodyniecki
committed
Sep 16, 2021
1 parent
dd2f2c5
commit 66d2354
Showing
2 changed files
with
35 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,45 @@ | ||
/* | ||
* This file was generated by the Gradle 'init' task. | ||
* | ||
* This generated file contains a sample Java application project to get you started. | ||
* For more details take a look at the 'Building Java & JVM projects' chapter in the Gradle | ||
* User Manual available at https://docs.gradle.org/7.2/userguide/building_java_projects.html | ||
*/ | ||
|
||
plugins { | ||
// Apply the application plugin to add support for building a CLI application in Java. | ||
id 'application' | ||
id 'org.openjfx.javafxplugin' version '0.0.10' | ||
} | ||
|
||
repositories { | ||
// Use Maven Central for resolving dependencies. | ||
mavenCentral() | ||
// --module-path ../../Libraries/Java/javafx-sdk-11.0.2/lib | ||
} | ||
|
||
dependencies { | ||
// Use JUnit test framework. | ||
testImplementation 'junit:junit:4.13.2' | ||
|
||
// This dependency is used by the application. | ||
implementation 'com.google.guava:guava:30.1.1-jre' | ||
implementation 'org.postgresql:postgresql:42.2.19' | ||
|
||
testImplementation 'junit:junit:4.13.2' | ||
|
||
runtimeOnly "org.openjfx:javafx-graphics:$javafx.version:win" | ||
runtimeOnly "org.openjfx:javafx-graphics:$javafx.version:linux" | ||
runtimeOnly "org.openjfx:javafx-graphics:$javafx.version:mac" | ||
} | ||
|
||
application { | ||
// Define the main class for the application. | ||
mainClass = 'BerryGoodRecipes.App' | ||
} | ||
|
||
javafx { | ||
version = "11.0.2" | ||
modules = [ 'javafx.controls', 'javafx.fxml', 'javafx.media' ] | ||
} | ||
|
||
jar { | ||
manifest { | ||
attributes( | ||
'Main-Class': 'BerryGoodRecipes.Main', | ||
"Implementation-Title": "Gradle", | ||
"Implementation-Version": archiveVersion | ||
) | ||
} | ||
|
||
duplicatesStrategy = 'include' | ||
|
||
from { | ||
exclude '**/module-info.class' | ||
configurations.runtimeClasspath.findAll { it.name.endsWith('jar') }.collect { zipTree(it) } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// this file exists to fix the fat jar issue in JavaFX 11 | ||
|
||
package BerryGoodRecipes; | ||
|
||
import java.io.IOException; | ||
import java.sql.SQLException; | ||
|
||
public class Main { | ||
public static void main(String[] args) throws SQLException, IOException { | ||
App.main(args); | ||
} | ||
} |