Skip to content

Commit

Permalink
Support for JAXB 3 (#175)
Browse files Browse the repository at this point in the history
* updated to jaxb 3.0

* Update dependencies

* Avoid NPE when testing via IntelliJ IDE

* Update to JAXB 3 package

* Reinstate previously ignored test

* Update to JAXB 3 package

* Update for JAXB 3

Co-authored-by: rlfnb <rlfnb@rlfnb.de>
  • Loading branch information
adamretter and rlfnb authored Jan 17, 2021
1 parent 9e8c072 commit 2f5dd20
Show file tree
Hide file tree
Showing 121 changed files with 391 additions and 364 deletions.
47 changes: 32 additions & 15 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</parent>

<artifactId>jaxb2-maven-plugin</artifactId>
<version>2.5.1-SNAPSHOT</version>
<version>3.0.0-SNAPSHOT</version>
<packaging>maven-plugin</packaging>

<name>JAXB-2 Maven Plugin</name>
Expand Down Expand Up @@ -79,6 +79,19 @@
</developer>
</developers>

<contributors>
<contributor>
<name>Adam Retter</name>
<email>adam@evolvedbinary.com</email>
<organization>Evolved Binary</organization>
<organizationUrl>https://www.evolvedbinary.com</organizationUrl>
<roles>
<role>Patch Contributor</role>
</roles>
<timezone>Europe/London</timezone>
</contributor>
</contributors>

<prerequisites>
<maven>${mavenVersion}</maven>
</prerequisites>
Expand All @@ -101,23 +114,23 @@
<properties>
<!-- Define Maven and JDK versions-->
<mavenVersion>3.0.5</mavenVersion>
<mojo.java.target>1.7</mojo.java.target>
<mojo.java.target>1.8</mojo.java.target>

<!-- Plexus component versions -->
<plexus-compiler-api.version>2.5</plexus-compiler-api.version>
<plexus-utils.version>3.1.0</plexus-utils.version>
<plexus-build-api.version>0.0.7</plexus-build-api.version>

<!-- JAXB tooling versions -->
<jaxb.version>2.3.2</jaxb.version>
<stax-ex.version>1.8.1</stax-ex.version>
<qdox.version>2.0-M10</qdox.version>
<asm.version>7.1</asm.version>
<jaxb.version>3.0.0</jaxb.version>
<stax-ex.version>2.0.0</stax-ex.version>
<qdox.version>2.0.0</qdox.version>
<asm.version>9.0</asm.version>

<!-- Test scope dependencies' versions -->
<xmlunit.version>2.6.3</xmlunit.version>
<xmlunit.version>2.8.1</xmlunit.version>
<maven-plugin-plugin.version>3.5.1</maven-plugin-plugin.version>
<shared-algorithms.version>0.9.3</shared-algorithms.version>
<shared-algorithms.version>0.10.3</shared-algorithms.version>
</properties>

<dependencyManagement>
Expand All @@ -130,11 +143,14 @@
</dependency>

<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-bom</artifactId>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-xjc</artifactId>
<version>${jaxb.version}</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-jxc</artifactId>
<version>${jaxb.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>

<dependency>
Expand Down Expand Up @@ -168,11 +184,11 @@
within the JAXB RI artifacts.
-->
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-xjc</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-jxc</artifactId>
</dependency>

Expand Down Expand Up @@ -290,12 +306,13 @@
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.1.7</version>
<version>1.2.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.sun.istack</groupId>
<artifactId>istack-commons-runtime</artifactId>
<version>4.0.0</version>
<scope>runtime</scope>
</dependency>
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion src/it/mjaxb-14/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>2.3.2</version>
<version>3.0.0</version>
</dependency>
</dependencies>

Expand Down
4 changes: 2 additions & 2 deletions src/it/mjaxb-16/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>2.3.2</version>
<version>3.0.0</version>
</dependency>
</dependencies>

Expand Down Expand Up @@ -69,7 +69,7 @@
</executions>
<configuration>
<packageName>com.example.myschema</packageName>
<target>2.0</target>
<target>3.0</target>
</configuration>
</plugin>
</plugins>
Expand Down
2 changes: 1 addition & 1 deletion src/it/mjaxb-16/verify.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ File buildLog = new File(basedir, 'build.log')
def logPattern = "\\| \\[\\p{Digit}+\\]: ";
def sep = Pattern.quote(System.getProperty("file.separator"));
Pattern expectedTargetPattern = Pattern.compile(logPattern + "\\-target");
Pattern expectedTargetVersionPattern = Pattern.compile(logPattern + "2.0");
Pattern expectedTargetVersionPattern = Pattern.compile(logPattern + "3.0");
Pattern expectedExtensionPattern = Pattern.compile(logPattern + "\\-extension");
Pattern expectedEpisodePattern = Pattern.compile(logPattern + "\\-episode");
Pattern expectedEpisodeFilePattern = Pattern.compile(logPattern +
Expand Down
2 changes: 1 addition & 1 deletion src/it/mjaxb-17-warning/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>2.3.2</version>
<version>3.0.0</version>
</dependency>
</dependencies>

Expand Down
2 changes: 1 addition & 1 deletion src/it/mjaxb-17/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>2.3.2</version>
<version>3.0.0</version>
</dependency>
</dependencies>

Expand Down
2 changes: 1 addition & 1 deletion src/it/mjaxb-37/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>2.3.2</version>
<version>3.0.0</version>
</dependency>
</dependencies>

Expand Down
2 changes: 1 addition & 1 deletion src/it/mjaxb-55-partialdefaults/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>2.3.2</version>
<version>3.0.0</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package se.west.schema;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAttribute;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlType;

/**
* @author <a href="mailto:lj@jguru.se">Lennart J&ouml;relid</a>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package se.west.schema;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAttribute;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlType;

/**
* @author <a href="mailto:lj@jguru.se">Lennart J&ouml;relid</a>
Expand Down
2 changes: 1 addition & 1 deletion src/it/mjaxb-55/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>2.3.2</version>
<version>3.0.0</version>
</dependency>
</dependencies>

Expand Down
10 changes: 5 additions & 5 deletions src/it/mjaxb-55/src/main/java/se/west/schema/FooBar.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package se.west.schema;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAttribute;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlType;

/**
* @author <a href="mailto:lj@jguru.se">Lennart J&ouml;relid</a>
Expand Down
10 changes: 5 additions & 5 deletions src/it/mjaxb-55/src/main/java/se/west/schema/FooBaz.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package se.west.schema;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAttribute;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlType;

/**
* @author <a href="mailto:lj@jguru.se">Lennart J&ouml;relid</a>
Expand Down
2 changes: 1 addition & 1 deletion src/it/mjaxb-59/module1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>2.3.2</version>
<version>3.0.0</version>
</dependency>
</dependencies>

Expand Down
4 changes: 2 additions & 2 deletions src/it/mjaxb-59/module1/src/main/java/se/west/gnat/Foo.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package se.west.gnat;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;

@XmlAccessorType(XmlAccessType.FIELD)
public class Foo {
Expand Down
2 changes: 1 addition & 1 deletion src/it/mjaxb-64/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>2.3.2</version>
<version>3.0.0</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package se.west.shauqra;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlRootElement;
import jakarta.xml.bind.annotation.XmlType;

@XmlRootElement(name = "customerForNamelessFoo", namespace = "http://acme.com/customer-api")
@XmlType(name = "", namespace = "http://acme.com/customer-api")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package se.west.shauqra;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlRootElement;
import jakarta.xml.bind.annotation.XmlType;

@XmlRootElement(name = "customerForSomeFoo", namespace = "http://acme.com/customer-api")
@XmlType(name = "someFoo", namespace = "http://acme.com/customer-api")
Expand Down
2 changes: 1 addition & 1 deletion src/it/mjaxb-71/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>2.3.2</version>
<version>3.0.0</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package se.west.shauqra;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlRootElement;
import jakarta.xml.bind.annotation.XmlType;

@XmlRootElement(name = "customerForNamelessFoo", namespace = "http://acme.com/customer-api")
@XmlType(name = "", namespace = "http://acme.com/customer-api")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package se.west.shauqra;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlRootElement;
import jakarta.xml.bind.annotation.XmlType;

@XmlRootElement(name = "customerForSomeFoo", namespace = "http://acme.com/customer-api")
@XmlType(name = "someFoo", namespace = "http://acme.com/customer-api")
Expand Down
2 changes: 1 addition & 1 deletion src/it/mjaxb-80/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>2.3.2</version>
<version>3.0.0</version>
</dependency>
</dependencies>

Expand Down
10 changes: 5 additions & 5 deletions src/it/mjaxb-80/src/main/java/org/domain/ImportItemDTO.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.domain;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlType;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAttribute;
import jakarta.xml.bind.annotation.XmlSeeAlso;
import jakarta.xml.bind.annotation.XmlType;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(namespace = "http://schema.domain.org/integration/1.0",
Expand Down
6 changes: 3 additions & 3 deletions src/it/mjaxb-80/src/main/java/org/domain/ImportItemsDTO.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.domain;

import javax.xml.bind.annotation.XmlElementRef;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import jakarta.xml.bind.annotation.XmlElementRef;
import jakarta.xml.bind.annotation.XmlRootElement;
import jakarta.xml.bind.annotation.XmlType;
import java.util.ArrayList;
import java.util.List;

Expand Down
Loading

0 comments on commit 2f5dd20

Please sign in to comment.