diff --git a/README.md b/README.md
index fe5e980..ad19131 100644
--- a/README.md
+++ b/README.md
@@ -2,6 +2,14 @@
Example Maven Project for a JavaFX Application.
-Maven modules are configured so that even Images are build (including JPackage app-image).
+This projects includes multiple plugins:
+- Static code analysis with PMD and Spotbugs
+- Check of dependency updates during build
+- Build of an App-Image using JPackage
-Project includes PMD and spotbugs!
\ No newline at end of file
+The application is no longer a modular application so there are no problems with dependencies that are not providing a
+module-info.
+
+** Build the Image **
+To build the image, the profile Image must be used:
+```./mvnw -DImage install```
diff --git a/pom.xml b/pom.xml
index c6e6b77..69ed54c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,18 +17,17 @@
${project.artifactId}
${project.artifactId}
${project.artifactId}
- de.kneitzel.JavaFXApp
- FXAppModule
+ de.kneitzel.Main
17
3.6.3
- javafxapp
+ ${project.artifactId}-${project.version}
- 5.9.1
19
- 2.19.0
- 1.18.24
- 23.0.0
+ 24.0.1
+ 5.9.2
+ 1.18.26
+ 5.2.0
3.2.0
@@ -44,7 +43,7 @@
1.0.0.RC2
0.1.3
3.16.0
- 6.50.0
+ 6.55.0
2.11.0
4.7.2.0
4.7.3
@@ -58,6 +57,7 @@
+
org.openjfx
javafx-controls
@@ -79,6 +79,7 @@
${javafx.version}
+
org.projectlombok
lombok
@@ -86,6 +87,34 @@
provided
+
+
+ org.junit.jupiter
+ junit-jupiter-engine
+ ${junit.version}
+ test
+
+
+ org.junit.jupiter
+ junit-jupiter-params
+ ${junit.version}
+ test
+
+
+
+
+ org.mockito
+ mockito-core
+ ${mockito.version}
+ test
+
+
+ org.mockito
+ mockito-junit-jupiter
+ ${mockito.version}
+ test
+
+
org.jetbrains
@@ -94,28 +123,10 @@
compile
-
- org.apache.logging.log4j
- log4j-api
- ${log4j.version}
-
-
-
- org.apache.logging.log4j
- log4j-core
- ${log4j.version}
-
-
-
- org.junit.jupiter
- junit-jupiter-engine
- ${junit.version}
- test
-
- ${jar.file}
+ ${jar.filename}
org.apache.maven.plugins
@@ -290,94 +301,109 @@
-
- org.apache.maven.plugins
- maven-dependency-plugin
- ${maven.dependency.plugin}
-
-
-
- copy-dependencies
- package
-
- copy-dependencies
-
-
- ${project.build.directory}/modules
- org.openjfx
- runtime
-
-
- ${project.groupId}
- ${project.artifactId}
- ${project.version}
- ${project.packaging}
-
-
- false
- false
- true
-
-
-
-
-
- copy
- install
-
- copy
-
-
- ${project.build.directory}/modules
-
-
- ${project.groupId}
- ${project.artifactId}
- ${project.version}
- ${project.packaging}
- ${project.build.finalName}.jar
-
-
- true
-
-
-
-
-
-
- com.github.akman
- jpackage-maven-plugin
- ${jpackage.maven.plugin}
-
- ${appName}
- IMAGE
-
-
-
-
- javafx\..*
-
-
-
-
-
- javafx.controls
- javafx.graphics
- javafx.fxml
-
- ${main.class}
- ${project.build.directory}/modules
- ${jar.file}.jar
-
-
-
- install
-
- jpackage
-
-
-
-
+
+
+
+
+
+ Image
+
+
+ Image
+
+
+
+ ${jar.filename}
+
+
+
+ org.apache.maven.plugins
+ maven-dependency-plugin
+ ${maven.dependency.plugin}
+
+
+
+ copy-dependencies
+ package
+
+ copy-dependencies
+
+
+ ${project.build.directory}/modules
+ runtime
+ false
+ false
+ true
+
+
+
+
+
+ copy
+ install
+
+ copy
+
+
+ ${project.build.directory}/modules
+
+
+ ${project.groupId}
+ ${project.artifactId}
+ ${project.version}
+ ${project.packaging}
+ ${project.build.finalName}.jar
+
+
+ true
+
+
+
+
+
+
+ com.github.akman
+ jpackage-maven-plugin
+ ${jpackage.maven.plugin}
+
+ ${appName}
+ IMAGE
+
+
+
+
+ javafx\..*
+
+
+
+
+
+ javafx.controls
+ javafx.graphics
+ javafx.fxml
+ javafx.web
+
+ ${main.class}
+ ${project.build.directory}/modules
+ ${jar.filename}.jar
+
+
+
+ install
+
+ jpackage
+
+
+
+
+
+
+
+
+
diff --git a/src/main/java/de/kneitzel/JavaFXApp.java b/src/main/java/de/kneitzel/JavaFXApp.java
index 686f449..b477580 100644
--- a/src/main/java/de/kneitzel/JavaFXApp.java
+++ b/src/main/java/de/kneitzel/JavaFXApp.java
@@ -1,24 +1,17 @@
package de.kneitzel;
import javafx.application.Application;
-import javafx.application.Platform;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
-import javafx.scene.control.Button;
-import javafx.scene.layout.AnchorPane;
-import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
import java.io.IOException;
public class JavaFXApp extends Application {
- static final Logger logger = LogManager.getLogger(JavaFXApp.class);
@Override
- public void start(Stage primaryStage) throws IOException {
+ public void start(Stage primaryStage) {
try {
primaryStage.setTitle("Hello World!");
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("MainWindow.fxml"));
@@ -26,16 +19,12 @@ public class JavaFXApp extends Application {
primaryStage.setScene(new Scene(root));
primaryStage.show();
} catch (Exception ex) {
- logger.error("Exception!", ex);
+ System.out.println("Exception: " + ex.getMessage());
+ ex.printStackTrace();
}
}
public static void main(String[] args) {
- logger.warn("Starting ...");
- try {
launch(args);
- } catch (Exception ex) {
- logger.error("Exception!", ex);
- }
}
}
diff --git a/src/main/java/de/kneitzel/Main.java b/src/main/java/de/kneitzel/Main.java
new file mode 100644
index 0000000..21d7743
--- /dev/null
+++ b/src/main/java/de/kneitzel/Main.java
@@ -0,0 +1,15 @@
+package de.kneitzel;
+
+/**
+ * Another Main class as workaround when the JavaFX Application ist started without
+ * taking care os Classloader Requirements of JavaFX. (Important when starting from inside NetBeans!)
+ */
+public class Main {
+ /**
+ * Additional main methode to start Application.
+ * @param args Commandline Arguments.
+ */
+ public static void main(String[] args) {
+ JavaFXApp.main(args);
+ }
+}
\ No newline at end of file
diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml
deleted file mode 100644
index acc1d8c..0000000
--- a/src/main/resources/log4j2.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file