From 5c15836c9ad61047f5c95471adae77efcc3b3e98 Mon Sep 17 00:00:00 2001 From: Michael Schnell Date: Fri, 6 Oct 2023 08:59:55 +0200 Subject: [PATCH] Migrated to jakarta namespace --- README.md | 4 +++ .../org/fuin/marchetyper/core/Archetype.java | 6 ++-- .../org/fuin/marchetyper/core/ConfigImpl.java | 18 +++++------ .../org/fuin/marchetyper/core/FileFilter.java | 6 ++-- .../org/fuin/marchetyper/core/Mapping.java | 8 ++--- .../fuin/marchetyper/core/MavenExecutor.java | 4 +-- .../org/fuin/marchetyper/core/Property.java | 8 ++--- .../marchetyper/core/SimplePathMapper.java | 4 +-- .../org/fuin/marchetyper/core/Variable.java | 12 +++---- .../ReplacingFileReaderTest-expected.java | 14 ++++---- .../ReplacingFileReaderTest-original.java | 14 ++++---- pom.xml | 32 +++++++++---------- 12 files changed, 67 insertions(+), 63 deletions(-) diff --git a/README.md b/README.md index 7df2b0f..8ada290 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,10 @@ Makes Maven Archetype creation a breeze [![LGPLv3 License](http://img.shields.io/badge/license-LGPLv3-blue.svg)](https://www.gnu.org/licenses/lgpl.html) [![Java Development Kit 11](https://img.shields.io/badge/JDK-11-green.svg)](https://openjdk.java.net/projects/jdk/11/) +## Versions +- 0.5.x (or later) = **Java 11** with new **jakarta** namespace +- 0.4.x = **Java 11** before namespace change from 'javax' to 'jakarta' + ## Why? You may argue "Creating a Maven Archetype from a project is already possible using the [create-from-project](https://maven.apache.org/archetype/maven-archetype-plugin/create-from-project-mojo.html) Mojo". You are right. Unfortunately it's pretty limited and does not allow much individual customization. That's where the **marchetyper** kicks in. It has a specialized configuration file and allows **repeating the creation process** every time your existing example project has changed. As your example project will change over time, having an *automated build* that automatically updates your Archetype is the major benefit of **marchetyper**. diff --git a/core/src/main/java/org/fuin/marchetyper/core/Archetype.java b/core/src/main/java/org/fuin/marchetyper/core/Archetype.java index 3acf790..810fde2 100755 --- a/core/src/main/java/org/fuin/marchetyper/core/Archetype.java +++ b/core/src/main/java/org/fuin/marchetyper/core/Archetype.java @@ -22,9 +22,9 @@ import java.util.Collections; import java.util.List; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; /** * Archetype definition. diff --git a/core/src/main/java/org/fuin/marchetyper/core/ConfigImpl.java b/core/src/main/java/org/fuin/marchetyper/core/ConfigImpl.java index 4d59cab..cd15dc5 100755 --- a/core/src/main/java/org/fuin/marchetyper/core/ConfigImpl.java +++ b/core/src/main/java/org/fuin/marchetyper/core/ConfigImpl.java @@ -25,15 +25,6 @@ import java.util.Collections; import java.util.List; -import javax.validation.constraints.NotNull; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Unmarshaller; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlRootElement; - import org.fuin.objects4j.common.Contract; import org.fuin.objects4j.common.FileExists; import org.fuin.objects4j.common.FileExistsValidator; @@ -42,6 +33,15 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import jakarta.validation.constraints.NotNull; +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.JAXBException; +import jakarta.xml.bind.Unmarshaller; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElementWrapper; +import jakarta.xml.bind.annotation.XmlRootElement; + /** * Application configuration. */ diff --git a/core/src/main/java/org/fuin/marchetyper/core/FileFilter.java b/core/src/main/java/org/fuin/marchetyper/core/FileFilter.java index b471d56..e98c64c 100755 --- a/core/src/main/java/org/fuin/marchetyper/core/FileFilter.java +++ b/core/src/main/java/org/fuin/marchetyper/core/FileFilter.java @@ -19,11 +19,11 @@ import java.io.File; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; - import org.fuin.objects4j.common.Nullable; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlRootElement; + /** * Defines a path and/or file filter with expressions. */ diff --git a/core/src/main/java/org/fuin/marchetyper/core/Mapping.java b/core/src/main/java/org/fuin/marchetyper/core/Mapping.java index 6d3d5ac..d578880 100755 --- a/core/src/main/java/org/fuin/marchetyper/core/Mapping.java +++ b/core/src/main/java/org/fuin/marchetyper/core/Mapping.java @@ -19,14 +19,14 @@ import java.io.File; -import javax.xml.bind.Unmarshaller; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; - import org.fuin.objects4j.common.Contract; import org.fuin.objects4j.common.NotEmpty; import org.fuin.objects4j.common.Nullable; +import jakarta.xml.bind.Unmarshaller; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlRootElement; + /** * Maps a search term to a replace expression. */ diff --git a/core/src/main/java/org/fuin/marchetyper/core/MavenExecutor.java b/core/src/main/java/org/fuin/marchetyper/core/MavenExecutor.java index 07a88b6..6ee0424 100755 --- a/core/src/main/java/org/fuin/marchetyper/core/MavenExecutor.java +++ b/core/src/main/java/org/fuin/marchetyper/core/MavenExecutor.java @@ -21,8 +21,6 @@ import java.util.Arrays; import java.util.Properties; -import javax.validation.constraints.NotNull; - import org.apache.maven.shared.invoker.CommandLineConfigurationException; import org.apache.maven.shared.invoker.DefaultInvocationRequest; import org.apache.maven.shared.invoker.DefaultInvoker; @@ -37,6 +35,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import jakarta.validation.constraints.NotNull; + /** * Executes a Maven build. */ diff --git a/core/src/main/java/org/fuin/marchetyper/core/Property.java b/core/src/main/java/org/fuin/marchetyper/core/Property.java index 301ff99..8ffbb14 100755 --- a/core/src/main/java/org/fuin/marchetyper/core/Property.java +++ b/core/src/main/java/org/fuin/marchetyper/core/Property.java @@ -17,14 +17,14 @@ */ package org.fuin.marchetyper.core; -import javax.xml.bind.Unmarshaller; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; - import org.fuin.objects4j.common.Contract; import org.fuin.objects4j.common.NotEmpty; import org.fuin.objects4j.common.Nullable; +import jakarta.xml.bind.Unmarshaller; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlRootElement; + /** * Maven archetype property. */ diff --git a/core/src/main/java/org/fuin/marchetyper/core/SimplePathMapper.java b/core/src/main/java/org/fuin/marchetyper/core/SimplePathMapper.java index 672e660..e886894 100755 --- a/core/src/main/java/org/fuin/marchetyper/core/SimplePathMapper.java +++ b/core/src/main/java/org/fuin/marchetyper/core/SimplePathMapper.java @@ -22,13 +22,13 @@ import java.util.Arrays; import java.util.List; -import javax.validation.constraints.NotNull; - import org.apache.commons.lang3.StringUtils; import org.fuin.objects4j.common.ConstraintViolationException; import org.fuin.objects4j.common.Contract; import org.fuin.utils4j.Utils4J; +import jakarta.validation.constraints.NotNull; + /** * Replaces a source path segment (structure of directories) with a target path segment. Example: Given a directory structure * 'a/b/c/d/e/f/g'. Source segment 'b/c/d' can be replaced with target segment 'x' . The target structure will be 'a/x/e/f/g'. Files within diff --git a/core/src/main/java/org/fuin/marchetyper/core/Variable.java b/core/src/main/java/org/fuin/marchetyper/core/Variable.java index 96212ed..a6919c1 100644 --- a/core/src/main/java/org/fuin/marchetyper/core/Variable.java +++ b/core/src/main/java/org/fuin/marchetyper/core/Variable.java @@ -17,16 +17,16 @@ */ package org.fuin.marchetyper.core; -import javax.validation.constraints.NotNull; -import javax.xml.bind.Unmarshaller; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlTransient; - import org.fuin.objects4j.common.ConstraintViolationException; import org.fuin.objects4j.common.Contract; import org.fuin.objects4j.common.NotEmpty; +import jakarta.validation.constraints.NotNull; +import jakarta.xml.bind.Unmarshaller; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlTransient; + /** * Variable that holds a transformation of a source property. */ diff --git a/core/src/test/resources/ReplacingFileReaderTest-expected.java b/core/src/test/resources/ReplacingFileReaderTest-expected.java index b46e876..fd77ac0 100755 --- a/core/src/test/resources/ReplacingFileReaderTest-expected.java +++ b/core/src/test/resources/ReplacingFileReaderTest-expected.java @@ -3,13 +3,13 @@ import java.lang.management.ManagementFactory; -import javax.annotation.PostConstruct; -import javax.annotation.PreDestroy; -import javax.ejb.Singleton; -import javax.ejb.Startup; -import javax.inject.Inject; -import javax.management.MBeanServer; -import javax.management.ObjectName; +import jakarta.annotation.PostConstruct; +import jakarta.annotation.PreDestroy; +import jakarta.ejb.Singleton; +import jakarta.ejb.Startup; +import jakarta.inject.Inject; +import jakarta.management.MBeanServer; +import jakarta.management.ObjectName; import com.udojava.jmx.wrapper.JMXBeanWrapper; diff --git a/core/src/test/resources/ReplacingFileReaderTest-original.java b/core/src/test/resources/ReplacingFileReaderTest-original.java index 44ecf5a..154ad44 100755 --- a/core/src/test/resources/ReplacingFileReaderTest-original.java +++ b/core/src/test/resources/ReplacingFileReaderTest-original.java @@ -19,13 +19,13 @@ import java.lang.management.ManagementFactory; -import javax.annotation.PostConstruct; -import javax.annotation.PreDestroy; -import javax.ejb.Singleton; -import javax.ejb.Startup; -import javax.inject.Inject; -import javax.management.MBeanServer; -import javax.management.ObjectName; +import jakarta.annotation.PostConstruct; +import jakarta.annotation.PreDestroy; +import jakarta.ejb.Singleton; +import jakarta.ejb.Startup; +import jakarta.inject.Inject; +import jakarta.management.MBeanServer; +import jakarta.management.ObjectName; import com.udojava.jmx.wrapper.JMXBeanWrapper; diff --git a/pom.xml b/pom.xml index 8aad276..8bc36e9 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ org.fuin pom - 1.7.0 + 1.7.1 org.fuin.marchetyper @@ -48,7 +48,7 @@ org.junit.jupiter junit-jupiter-engine - 5.9.2 + 5.10.0 @@ -60,7 +60,7 @@ nl.jqno.equalsverifier equalsverifier - 3.14 + 3.15.2 @@ -72,19 +72,19 @@ commons-io commons-io - 2.11.0 + 2.14.0 org.glassfish.jaxb jaxb-runtime - 2.3.3 + 4.0.3 org.hibernate.validator hibernate-validator - 6.2.5.Final + 8.0.1.Final @@ -96,25 +96,25 @@ org.fuin ext4logback - 0.2.0 + 0.4.0 org.fuin utils4j - 0.11.1 + 0.12.0 org.fuin objects4j - 0.7.1 + 0.8.0 org.apache.commons commons-lang3 - 3.12.0 + 3.13.0 @@ -126,19 +126,19 @@ jakarta.validation jakarta.validation-api - 2.0.2 + 3.0.2 org.slf4j slf4j-api - 2.0.6 + 2.0.7 ch.qos.logback logback-classic - 1.4.6 + 1.4.11 @@ -150,7 +150,7 @@ org.jboss.weld.se weld-se-core - 3.1.9.Final + 5.1.2.Final @@ -162,13 +162,13 @@ org.apache.maven maven-plugin-api - 3.9.0 + 3.9.5 org.apache.maven.plugin-tools maven-plugin-annotations - 3.4 + 3.9.0