Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.release>11</maven.compiler.release>
<jaxb.version>2.3.1</jaxb.version>
<jaxb.rt.version>2.4.0-b180830.0438</jaxb.rt.version>
<jaxb.version>4.0.5</jaxb.version>
<jaxb.rt.version>4.0.9</jaxb.rt.version>
<jaxb.plugins.version>4.0.16</jaxb.plugins.version>
</properties>

<dependencyManagement>
Expand All @@ -46,8 +47,8 @@
<version>1.6.0</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>${jaxb.version}</version>
</dependency>
<dependency>
Expand All @@ -56,9 +57,14 @@
<version>${jaxb.rt.version}</version>
</dependency>
<dependency>
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-basics-runtime</artifactId>
<version>${jaxb2_commons.version}</version>
<groupId>jakarta.activation</groupId>
<artifactId>jakarta.activation-api</artifactId>
<version>2.1.4</version>
</dependency>
<dependency>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-plugins-runtime</artifactId>
<version>${jaxb.plugins.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down
2 changes: 1 addition & 1 deletion xml/jaxb/generate-code-from-xsd/README.MD
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Configure Maven to generate Java from an XSD schema

This project shows how to configure the [maven-jaxb2-plugin](https://github.com/highsource/maven-jaxb2-plugin) to generate JAXB code, enhanced with the [jaxb2-basics](https://github.com/highsource/jaxb2-basics) to get basic `Object` behavior (`hashCode`, `equals` and `toString`), and fluent builders. There is also a small JUnit test included, which verifies that the Object enhancements to plain JAXB code is present.
This project shows how to configure the [jaxb-maven-plugin](https://github.com/highsource/jaxb-tools) (the Jakarta-namespace continuation of the old `maven-jaxb2-plugin`) to generate JAXB code, enhanced with [jaxb-plugins](https://github.com/highsource/jaxb-tools) (formerly `jaxb2-basics`) to get basic `Object` behavior (`hashCode`, `equals` and `toString`), and fluent builders. There is also a small JUnit test included, which verifies that the Object enhancements to plain JAXB code is present.

## To generate, compiler and check the generated code
```sh
Expand Down
52 changes: 19 additions & 33 deletions xml/jaxb/generate-code-from-xsd/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,43 +12,29 @@

<artifactId>generate-code-from-xsd</artifactId>

<properties>
<jaxb2_commons.version>1.11.1</jaxb2_commons.version>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-basics</artifactId>
<version>1.11.1</version>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-plugins</artifactId>
<version>${jaxb.plugins.version}</version>
</dependency>
<dependency>
<groupId>net.codesup.util</groupId>
<artifactId>jaxb2-rich-contract-plugin</artifactId>
<version>2.1.0</version>
<artifactId>jaxb-rich-contract-plugin</artifactId>
<version>4.2.1.2</version>
</dependency>
</dependencies>
</dependencyManagement>

<build>

<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>4.1.0</version>
</plugin>
</plugins>
</pluginManagement>

<plugins>

<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.14.0</version>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-maven-plugin</artifactId>
<version>${jaxb.plugins.version}</version>
<dependencies>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
Expand All @@ -63,20 +49,20 @@
<arg>-Xequals</arg>
<arg>-XhashCode</arg>
<arg>-Xfluent-builder</arg>
<!-- Workaround for issue #21 in jaxb2-rich-client: https://github.com/mklemm/jaxb2-rich-contract-plugin/issues/21
Which is probably harmless since partial copies aren't needed (I don't even
know what it is:)). -->
<arg>-copyPartial=n</arg>
<!-- Avoid generating the partial-copy Selector API: its nested "Selector" class
clashes with com.kscs.util.jaxb.Selector for schemas that also define
a type with that name (e.g. Maven's own pom.xsd). -->
<arg>-fluent-builder.copyPartial=n</arg>
<arg>-Ximmutable</arg>
</args>
<plugins>
<plugin>
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-basics</artifactId>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-plugins</artifactId>
</plugin>
<plugin>
<groupId>net.codesup.util</groupId>
<artifactId>jaxb2-rich-contract-plugin</artifactId>
<artifactId>jaxb-rich-contract-plugin</artifactId>
</plugin>
</plugins>
</configuration>
Expand All @@ -97,16 +83,16 @@

<dependencies>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
</dependency>
<dependency>
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-basics-runtime</artifactId>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-plugins-runtime</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down
Loading