diff --git a/README.md b/README.md index 97512bd..5ea55c4 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,15 @@ Example Maven Project for a JavaFX Application. +**Update**: Added profile fatjar + **Update**: Added reporting to create a site (html documentation of project) **Update**: Java 21 is now fully supported This projects includes multiple plugins: -- Build of an App-Image using JPackage +- Build of an App-Image using JPackage (Profile: image) +- Build of an fat jar (Profile: fatjar) - Use of Maven Wrapper - Static code analysis with PMD and Spotbugs - Check of dependency updates during build diff --git a/documentation/de/CheckUpdates.md b/documentation/de/CheckUpdates.md new file mode 100644 index 0000000..0555094 --- /dev/null +++ b/documentation/de/CheckUpdates.md @@ -0,0 +1,103 @@ +# Überprüfung auf Updates + +Eine regelmäßige Überprüfung auf Updates von Plugins und Dependencies ist aus mehreren Gründen essenziell für die +Softwareentwicklung. Erstens garantiert sie Sicherheit, indem sie sicherstellt, dass alle verwendeten Komponenten auf +dem neuesten Stand sind und bekannte Sicherheitslücken geschlossen werden. Zweitens verbessert sie die Leistung und +Stabilität der Software, da Updates oft Optimierungen und Fehlerbehebungen enthalten. Drittens ermöglicht die +Aktualisierung den Zugang zu neuen Funktionen und Technologien, was die Entwicklung effizienter und zukunftssicher +macht. Durch das regelmäßige Aktualisieren wird zudem die Kompatibilität mit anderen Tools und Systemen sichergestellt, +was die Integration und Wartung vereinfacht. + +## Codehaus Version Plugin + +Das Codehaus Versions Maven Plugin ist ein nützliches Werkzeug in der Softwareentwicklung, da es überprüft, ob neuere +Versionen von Plugins oder Dependencies verfügbar sind. Es hilft Entwicklern, ihre Projekte auf dem neuesten Stand zu +halten, indem es automatisch nach Updates sucht und Vorschläge für mögliche Upgrades macht. Diese Funktionalität ist +besonders wichtig, um sicherzustellen, dass die verwendeten Komponenten aktuell sind und um von den neuesten +Sicherheitspatches, Fehlerbehebungen und Leistungsverbesserungen zu profitieren. Das Plugin bietet eine einfache und +effiziente Möglichkeit, die Softwarewartung zu optimieren und die Softwarequalität zu verbessern. + +## Einbindung in das Projekt + +Das Plugin ist sehr einfach in ein Projekt einbindbar: +```xml + + org.codehaus.mojo + versions-maven-plugin + ${codehaus.version.plugin} + + + validate + + display-dependency-updates + display-plugin-updates + display-property-updates + + + + +``` + +Wichtig ist, dass die Ziele sowohl für Abhängigkeiten, Plugins als auch Properties ausgeführt wird, damit kein Update +übersehen wird. + +## Probleme + +Die Verfügbarkeit von Updates für Plugins und Dependencies in einem Maven-Projekt kann teilweise von der verwendeten +Version von Maven selbst abhängen. Neuere Versionen von Maven unterstützen oft aktuellere Plugins und Dependencies, +die verbesserte Funktionen und Sicherheitsupdates bieten können. Daher ist es wichtig, sicherzustellen, dass ein +Projekt mit einer spezifischen, minimal erforderlichen Maven-Version betrieben wird. + +Um dies zu gewährleisten, kann das Maven Enforcer Plugin eingesetzt werden. Dieses Plugin erlaubt es, bestimmte Regeln +innerhalb der Build-Umgebung durchzusetzen, darunter auch die Anforderung einer minimalen Maven-Version. Durch die +Konfiguration des Maven Enforcer Plugins im Build-Prozess wird sichergestellt, dass der Build nur dann erfolgreich +durchgeführt wird, wenn die verwendete Maven-Version der definierten Mindestanforderung entspricht. Dies hilft, +Inkonsistenzen und potenzielle Fehler aufgrund von Versionskonflikten zu vermeiden und fördert die Stabilität und +Sicherheit des Projekts. + +Einbindung des Maven Enforcer Plugins: +```xml + + org.apache.maven.plugins + maven-enforcer-plugin + ${maven.enforcer.plugin} + + + enforce-versions + + enforce + + + + + ${required.maven.version} + + + + + + +``` + +## Ergebnis + +Während des Build-Vorgangens bekommt man eine Ausgabe ähnlich: +```text +[INFO] The following version properties are referencing the newest available version: +[INFO] ${codehaus.version.plugin} ................................... 2.16.2 +[INFO] ${javafx.maven.plugin} ........................................ 0.0.8 +[INFO] The following version property updates are available: +[INFO] ${javafx.version} ................................. 21.0.3 -> 23-ea+3 +[INFO] ${junit.version} ................................ 5.10.2 -> 5.11.0-M1 +[INFO] ${maven.site.plugin} ......................... 4.0.0-M13 -> 4.0.0-M14 +``` + +**Hinweis** Das Tool führt keine Bewertung der Updates durch. So zeigt die kopierte Ausgabe drei mögliche +Aktualisierungen: + +- javafx.version könnte auf eine early access Version aktualisiert werden. Das ist etwas, das man sich natürlich gut +überlegen sollte (und bei JavaFX kann es sinnvoll sein, die Main-Version gleich zur Java Version zu halten). +- Für JUnit gibt es eine neue Milestone Version. Auch hier kann es Sinn machen, keine Milestone Versionen zu verwenden. +- Für das Site Version wird bereits auf eine Milestone Version gesetzt. Hier macht das Update dann durchaus Sinn. + +**Es wird also deutlich, dass hier eine bewusste Bewertung stattfindet, die vom Plugin nicht geleistet werden kann.** \ No newline at end of file diff --git a/documentation/de/_Index.md b/documentation/de/_Index.md index b1d7c2f..2ad5511 100644 --- a/documentation/de/_Index.md +++ b/documentation/de/_Index.md @@ -5,7 +5,7 @@ ## Maven Projekt - [Übersicht über das Maven Projekt](MavenProject.md) - [Erzeugung eines Images](ImageCreation.md) -- Überprüfung auf Aktualisierungen +- [Überprüfung auf Updates](CheckUpdates.md) ## [Statische Codeanalyse](StaticCodeAnalysis.md) - [PMD](PMD.md) diff --git a/documentation/en/CheckUpdates.md b/documentation/en/CheckUpdates.md new file mode 100644 index 0000000..331876d --- /dev/null +++ b/documentation/en/CheckUpdates.md @@ -0,0 +1,75 @@ +# Checking for Updates + +Regular updates of plugins and dependencies are crucial for software development for several reasons. First, they +ensure security by keeping all components up-to-date and closing known vulnerabilities. Second, updates often include +optimizations and bug fixes, which improve the performance and stability of the software. Third, updating allows access +to new features and technologies, making development more efficient and future-proof. Regular updates also ensure +compatibility with other tools and systems, simplifying integration and maintenance. + +## Codehaus version plugin + +The Codehaus Versions Maven Plugin is a valuable tool in software development, as it checks for newer versions of +plugins or dependencies. It assists developers in keeping their projects up-to-date by automatically searching for +updates and suggesting possible upgrades. This functionality is especially important to ensure that the components +used are current and to benefit from the latest security patches, bug fixes, and performance improvements. The plugin +offers a simple and efficient way to optimize software maintenance and enhance software quality. + +## Inclusion in project + +The plugin can easily be added to the maven project: +```xml + + org.codehaus.mojo + versions-maven-plugin + ${codehaus.version.plugin} + + + validate + + display-dependency-updates + display-plugin-updates + display-property-updates + + + + +``` + +It is important, that we start the goals to display updates for dependencies, plugins and also properties. + +## Problems + +The availability of updates for plugins and dependencies in a Maven project can sometimes depend on the version of +Maven being used. Newer versions of Maven often support more current plugins and dependencies, which can offer improved +features and security updates. Therefore, it is important to ensure that a project is operated with a specific, minimum +required version of Maven. + +To enforce this, the Maven Enforcer Plugin can be utilized. This plugin allows specific rules to be enforced within +the build environment, including the requirement for a minimum Maven version. By configuring the Maven Enforcer Plugin +in the build process, it is ensured that the build only proceeds successfully if the Maven version used meets the +defined minimum requirement. This helps to avoid inconsistencies and potential errors due to version conflicts, +promoting the stability and security of the project. + +Inclusion of the maven enforcer plugin: +```xml + + org.apache.maven.plugins + maven-enforcer-plugin + ${maven.enforcer.plugin} + + + enforce-versions + + enforce + + + + + ${required.maven.version} + + + + + + +``` \ No newline at end of file diff --git a/documentation/en/_Index.md b/documentation/en/_Index.md index cfd09a4..02a92cf 100644 --- a/documentation/en/_Index.md +++ b/documentation/en/_Index.md @@ -5,7 +5,7 @@ ## Maven Project - [Maven Project Overview](MavenProject.md) - [Image Creation](ImageCreation.md) -- Checking of Updates +- [Checking for Updates](CheckUpdates.md) ## [Static Code Analysis](StaticCodeAnalysis.md) - [PMD](PMD.md) diff --git a/pom.xml b/pom.xml index 1d7b63a..a9e1acb 100644 --- a/pom.xml +++ b/pom.xml @@ -43,6 +43,7 @@ 3.6.3 3.5.0 3.3.1 + 3.5.3 4.0.0-M14 3.2.5 1.0.0.RC2 @@ -465,5 +466,59 @@ + + + fatjar + + + fatjar + + + + + + org.apache.maven.plugins + maven-shade-plugin + ${maven.shade.plugin} + + + package + + shade + + + + + true + full + + + + + ${main.class} + 1.0 + + + + + + *:* + + META-INF/MANIFEST.MF + **/module-info.class + META-INF/*.SF + META-INF/*.DSA + META-INF/*.RSA + + + + + + + +