Repository: xlate/staedi
Pull request #297 (2022-09-21 00:41:14)

Bump JAXB API and runtime to 4.0.0
Update dependencies to properly identify JAXB as test-only dependency.


Patch:
diff --git a/pom.xml b/pom.xml
index c1dfc47..b9e7e8f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -56,7 +56,7 @@
     <sonar.host.url>https://sonarcloud.io</sonar.host.url>
     <sonar.organization>xlate</sonar.organization>
 
-    <version.jakarta.xml.bind.api>2.3.3</version.jakarta.xml.bind.api>
+    <version.jakarta.xml.bind.api>4.0.0</version.jakarta.xml.bind.api>
     <version.jakarta.json.api>2.0.1</version.jakarta.json.api>
     <version.javax.json.api>1.1.4</version.javax.json.api>
     <version.jackson>2.13.4</version.jackson>
@@ -184,11 +184,6 @@
 
   <dependencyManagement>
     <dependencies>
-      <dependency>
-        <groupId>jakarta.xml.bind</groupId>
-        <artifactId>jakarta.xml.bind-api</artifactId>
-        <version>${version.jakarta.xml.bind.api}</version>
-      </dependency>
       <dependency>
         <groupId>jakarta.json</groupId>
         <artifactId>jakarta.json-api</artifactId>
@@ -216,10 +211,15 @@
         <artifactId>mockito-core</artifactId>
         <version>4.8.0</version>
       </dependency>
+      <dependency>
+        <groupId>jakarta.xml.bind</groupId>
+        <artifactId>jakarta.xml.bind-api</artifactId>
+        <version>${version.jakarta.xml.bind.api}</version>
+      </dependency>
       <dependency>
         <groupId>org.glassfish.jaxb</groupId>
         <artifactId>jaxb-runtime</artifactId>
-        <version>2.3.6</version>
+        <version>4.0.1</version>
       </dependency>
       <dependency>
         <groupId>org.glassfish</groupId>
@@ -245,11 +245,6 @@
   </dependencyManagement>
 
   <dependencies>
-    <dependency>
-      <groupId>jakarta.xml.bind</groupId>
-      <artifactId>jakarta.xml.bind-api</artifactId>
-      <optional>true</optional>
-    </dependency>
     <dependency>
       <groupId>jakarta.json</groupId>
       <artifactId>jakarta.json-api</artifactId>
@@ -297,9 +292,39 @@
       <artifactId>javax.json</artifactId>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>jakarta.xml.bind</groupId>
+      <artifactId>jakarta.xml.bind-api</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.glassfish.jaxb</groupId>
+      <artifactId>jaxb-runtime</artifactId>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 
   <profiles>
+    <profile>
+      <id>legacy</id>
+      <activation>
+        <jdk>(,11)</jdk>
+      </activation>
+      <dependencyManagement>
+        <dependencies>
+          <dependency>
+            <groupId>jakarta.xml.bind</groupId>
+            <artifactId>jakarta.xml.bind-api</artifactId>
+            <version>3.0.1</version>
+          </dependency>
+          <dependency>
+            <groupId>org.glassfish.jaxb</groupId>
+            <artifactId>jaxb-runtime</artifactId>
+            <version>3.0.2</version>
+          </dependency>
+        </dependencies>
+      </dependencyManagement>
+    </profile>
     <profile>
       <id>multirelease</id>
       <activation>
@@ -341,13 +366,6 @@
           </plugins>
         </pluginManagement>
       </build>
-      <dependencies>
-        <dependency>
-          <groupId>org.glassfish.jaxb</groupId>
-          <artifactId>jaxb-runtime</artifactId>
-          <scope>test</scope>
-        </dependency>
-      </dependencies>
     </profile>
     <profile>
       <id>coverage</id>


Test patch:
diff --git a/src/test/java/io/xlate/edi/internal/bind/AcknowledgementBindTest.java b/src/test/java/io/xlate/edi/internal/bind/AcknowledgementBindTest.java
index 51f5517..8923a89 100644
--- a/src/test/java/io/xlate/edi/internal/bind/AcknowledgementBindTest.java
+++ b/src/test/java/io/xlate/edi/internal/bind/AcknowledgementBindTest.java
@@ -5,15 +5,16 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.Unmarshaller;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.stream.XMLStreamWriter;
 
+import jakarta.xml.bind.JAXBContext;
+import jakarta.xml.bind.Marshaller;
+import jakarta.xml.bind.Unmarshaller;
+import jakarta.xml.bind.annotation.XmlElement;
+import jakarta.xml.bind.annotation.XmlRootElement;
+import jakarta.xml.bind.annotation.XmlType;
+
 import org.junit.jupiter.api.Test;
 
 import io.xlate.edi.stream.EDIInputFactory;
diff --git a/src/test/java/io/xlate/edi/internal/bind/TransactionBindTest.java b/src/test/java/io/xlate/edi/internal/bind/TransactionBindTest.java
index 5cb1bbb..b8f573e 100644
--- a/src/test/java/io/xlate/edi/internal/bind/TransactionBindTest.java
+++ b/src/test/java/io/xlate/edi/internal/bind/TransactionBindTest.java
@@ -18,13 +18,6 @@ import java.util.stream.Collectors;
 import java.util.stream.IntStream;
 import java.util.stream.Stream;
 
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.SchemaOutputResolver;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlSchemaType;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.XmlValue;
 import javax.xml.namespace.QName;
 import javax.xml.transform.OutputKeys;
 import javax.xml.transform.Result;
@@ -34,6 +27,14 @@ import javax.xml.transform.dom.DOMResult;
 import javax.xml.transform.dom.DOMSource;
 import javax.xml.transform.stream.StreamResult;
 
+import jakarta.xml.bind.JAXBContext;
+import jakarta.xml.bind.SchemaOutputResolver;
+import jakarta.xml.bind.annotation.XmlElement;
+import jakarta.xml.bind.annotation.XmlRootElement;
+import jakarta.xml.bind.annotation.XmlSchemaType;
+import jakarta.xml.bind.annotation.XmlType;
+import jakarta.xml.bind.annotation.XmlValue;
+
 import org.junit.jupiter.api.Test;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;