Build NeitzelLib with Java 25 and refresh dependencies

This commit is contained in:
2026-11-14 13:02:01 +01:00
parent 7581cf0b45
commit 75b733abe3
13 changed files with 57 additions and 48 deletions
+7 -7
View File
@@ -16,10 +16,10 @@
You write the model, the FXML, and, where a screen needs them, a controller, reusable components, and converters. The library creates the view model. The [injection](../injection/README.md) container creates the controller, each component, and each converter.
The worked example is the `fx-example` module, package `de.neitzel.fx.example`. From the NeitzelLib root, with Java 21:
The worked example is the `fx-example` module, package `de.neitzel.fx.example`. From the NeitzelLib root, with Java 25:
```bash
./mvnw -pl fx-example -am -Dmaven.test.failure.ignore=false install
./mvnw -pl fx-example -am install
./mvnw -f fx-example/pom.xml javafx:run
```
@@ -33,15 +33,15 @@ These are the versions configured by this source snapshot, not a promise of comp
| Part | Baseline / relationship | Consumer responsibility |
| --- | --- | --- |
| JDK | Java 21 | Select a matching JDK for compilation and launch |
| Maven | Minimum 3.8.6; wrapper 3.9.11 | Use the wrapper or an installed Maven |
| JDK | Java 25 | Select a matching JDK for compilation and launch |
| Maven | Minimum 3.9.11; wrapper 3.9.11 | Use the wrapper or an installed Maven |
| Library | `de.neitzel.lib:fx:1.0-SNAPSHOT` | Install the local reactor first; no Central publication is assumed |
| Internal modules | `fx` directly depends on `core` and `injection` | Resolved transitively through Maven |
| JavaFX | 21.0.7: base, graphics, controls, FXML and web | Resolved transitively; deployment still needs platform-native artifacts |
| JavaFX | 27.0.1: base, graphics, controls, FXML and web | Resolved transitively; deployment still needs platform-native artifacts |
| Injection scanning | Reflections 0.10.2 | Brought by `injection` |
| Injection annotations | `jakarta.inject-api` 2.0.1 | Use Jakarta annotations, not `javax.inject` |
| Logging | SLF4J API 2.0.17 | Choose one logging backend; the example uses `slf4j-simple` 2.0.17 at runtime |
| Library build | Lombok 1.18.42 and test/analysis tooling | Not required in ordinary consumer source; use your own annotations only if wanted |
| Logging | SLF4J API 2.0.20 | Choose one logging backend; the example uses `slf4j-simple` 2.0.20 at runtime |
| Library build | Lombok 1.18.48 and test/analysis tooling | Not required in ordinary consumer source; use your own annotations only if wanted |
| Designer | Optional preview API / Model processor | Needed only for the selected Designer workflow, not normal `ViewLoader` use |
The quick-start POM adds only `fx` and a logging backend. Do not copy library build-time dependencies into an application just to obtain runtime binding. A project using injection alone needs the `injection` artifact and does not need JavaFX.
+8 -8
View File
@@ -1,19 +1,19 @@
# Your first JavaFX application
This walkthrough creates a complete Maven project with one editable name and a label that follows it. It uses Java 21, JavaFX 21.0.7 and the current `1.0-SNAPSHOT` NeitzelLib sources. These are local development artifacts; the instructions do not assume that this snapshot is published in Maven Central.
This walkthrough creates a complete Maven project with one editable name and a label that follows it. It uses Java 25, JavaFX 27.0.1 and the current `1.0-SNAPSHOT` NeitzelLib sources. These are local development artifacts; the instructions do not assume that this snapshot is published in Maven Central.
## Prepare the library
Install a JDK 21. Use the library's Maven wrapper (3.9.11), or a separate Maven installation version 3.8.6 or newer. Check `java -version` and `./mvnw -version` before building; on macOS, select the JDK with `export JAVA_HOME=$(/usr/libexec/java_home -v 21)` if necessary.
Install a JDK 25. Use the library's Maven wrapper (3.9.11), or a separate Maven installation version 3.9.11 or newer. Check `java -version` and `./mvnw -version` before building; on macOS, select the JDK with `export JAVA_HOME=$(/usr/libexec/java_home -v 25)` if necessary.
```bash
git clone https://gitea.neitzel.de/konrad/NeitzelLib.git
cd NeitzelLib
./mvnw -pl fx-example -am -Dmaven.test.failure.ignore=false install
./mvnw -pl fx-example -am install
./mvnw -f fx-example/pom.xml javafx:run
```
The `install` command installs the parent POM, `core`, `injection` and `fx` into your local Maven repository and builds the example. The repository hardcodes Surefire failure-ignore, so Maven success alone does not establish passing tests, even with the explicit flag. Inspect the XML reports as shown below. The `javafx:run` command opens the [person desk example](../../fx-example/README.md). Run `javafx:run` only on the example POM, not with `-am`: the reactor parent is not a JavaFX application.
The `install` command installs the parent POM, `core`, `injection` and `fx` into your local Maven repository and builds the example. Surefire fails the build when a test fails. The XML reports show which tests ran. The `javafx:run` command opens the [person desk example](../../fx-example/README.md). Run `javafx:run` only on the example POM, not with `-am`: the reactor parent is not a JavaFX application.
Check test results after the build (requires Python 3):
@@ -59,7 +59,7 @@ hello-fx/
<artifactId>hello-fx</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.release>21</maven.compiler.release>
<maven.compiler.release>25</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
@@ -71,7 +71,7 @@ hello-fx/
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>2.0.17</version>
<version>2.0.20</version>
<scope>runtime</scope>
</dependency>
</dependencies>
@@ -80,7 +80,7 @@ hello-fx/
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.14.1</version>
<version>3.16.0</version>
</plugin>
<plugin>
<groupId>org.openjfx</groupId>
@@ -155,7 +155,7 @@ public final class HelloApp extends Application {
<?import javafx.scene.control.TextField?>
<?import de.neitzel.fx.view.BindingList?>
<?import de.neitzel.fx.view.DirectBinding?>
<VBox xmlns="http://javafx.com/javafx/21" xmlns:fx="http://javafx.com/fxml/1"
<VBox xmlns="http://javafx.com/javafx/27" xmlns:fx="http://javafx.com/fxml/1"
spacing="12" prefWidth="360" prefHeight="120">
<fx:define>
<BindingList>
@@ -2,7 +2,9 @@ package de.neitzel.fx.tray;
import com.sun.glass.ui.Application;
/** Isolates the JavaFX 21 native Quit hook, which has no public JavaFX equivalent. */
import java.util.Map;
/** Isolates the JavaFX native Quit hook, which has no public JavaFX equivalent. */
final class MacApplicationQuit {
private MacApplicationQuit() {}
@@ -24,7 +26,12 @@ final class MacApplicationQuit {
@Override public void handleWillUnhideAction(Application a, long t) { if (previous != null) previous.handleWillUnhideAction(a,t); }
@Override public void handleDidUnhideAction(Application a, long t) { if (previous != null) previous.handleDidUnhideAction(a,t); }
@Override public void handleOpenFilesAction(Application a, long t, String[] files) { if (previous != null) previous.handleOpenFilesAction(a,t,files); }
@Override public boolean handleThemeChanged(String theme) { return previous != null && previous.handleThemeChanged(theme); }
@Override
public void handlePreferencesChanged(Map<String, Object> preferences) {
if (previous != null) {
previous.handlePreferencesChanged(preferences);
}
}
};
app.setEventHandler(handler);
return () -> {