From 6e87985d1c30b2e93859118ebabba68f5bf2c755 Mon Sep 17 00:00:00 2001 From: Laurent SCHOELENS <61973605+laurentschoelens@users.noreply.github.com> Date: Wed, 18 Oct 2023 22:22:49 +0200 Subject: [PATCH] [#443] add test project for multi-specversion --- .../tests/MAVEN_JAXB2_PLUGIN-70/pom.xml | 2 +- .../po-multi-specversion/jakarta/pom.xml | 43 ++++++++++++++++++ .../tests/po-multi-specversion/javax/pom.xml | 45 +++++++++++++++++++ .../tests/po-multi-specversion/pom.xml | 18 ++++++++ .../tests/po-multi-specversion/schema/pom.xml | 11 +++++ .../src/main/resources/purchaseorder.xjb | 11 +++++ .../src/main/resources/purchaseorder.xsd | 24 +++++----- maven-plugin/tests/pom.xml | 2 +- maven-plugin/tests/res/pom.xml | 6 +-- .../tests/res/src/main/resources/bindings.xjb | 2 +- .../jaxb/maven/tests/res/RunResMojo.java | 2 +- 11 files changed, 147 insertions(+), 19 deletions(-) create mode 100644 maven-plugin/tests/po-multi-specversion/jakarta/pom.xml create mode 100644 maven-plugin/tests/po-multi-specversion/javax/pom.xml create mode 100644 maven-plugin/tests/po-multi-specversion/pom.xml create mode 100644 maven-plugin/tests/po-multi-specversion/schema/pom.xml create mode 100644 maven-plugin/tests/po-multi-specversion/schema/src/main/resources/purchaseorder.xjb rename maven-plugin/tests/{po-2.3 => po-multi-specversion/schema}/src/main/resources/purchaseorder.xsd (71%) diff --git a/maven-plugin/tests/MAVEN_JAXB2_PLUGIN-70/pom.xml b/maven-plugin/tests/MAVEN_JAXB2_PLUGIN-70/pom.xml index fda5efa66..4913fa33c 100644 --- a/maven-plugin/tests/MAVEN_JAXB2_PLUGIN-70/pom.xml +++ b/maven-plugin/tests/MAVEN_JAXB2_PLUGIN-70/pom.xml @@ -30,7 +30,7 @@ org.jvnet.jaxb - jaxb-maven-plugin-tests-po-2.3 + jaxb-maven-plugin-tests-p_o ${project.version} purchaseorder.xsd diff --git a/maven-plugin/tests/po-multi-specversion/jakarta/pom.xml b/maven-plugin/tests/po-multi-specversion/jakarta/pom.xml new file mode 100644 index 000000000..3c5e0239b --- /dev/null +++ b/maven-plugin/tests/po-multi-specversion/jakarta/pom.xml @@ -0,0 +1,43 @@ + + 4.0.0 + jaxb-maven-plugin-tests-po-multi-specversion-jakarta + + org.jvnet.jaxb + jaxb-maven-plugin-tests-po-multi-specversion + 4.0.1-SNAPSHOT + + jar + JAXB Tools :: Maven Plugin :: Test [po-multi-specversion:jakarta] + + + org.jvnet.jaxb + jaxb-maven-plugin-tests-po-multi-specversion-schema + ${project.version} + + + org.glassfish.jaxb + jaxb-runtime + + + jakarta.xml.bind + jakarta.xml.bind-api + + + + + + org.jvnet.jaxb + jaxb-maven-plugin + + 3.0 + + + maven:org.jvnet.jaxb:jaxb-maven-plugin-tests-po-multi-specversion-schema!/purchaseorder.xsd + + + true + + + + + diff --git a/maven-plugin/tests/po-multi-specversion/javax/pom.xml b/maven-plugin/tests/po-multi-specversion/javax/pom.xml new file mode 100644 index 000000000..daf890ba6 --- /dev/null +++ b/maven-plugin/tests/po-multi-specversion/javax/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + jaxb-maven-plugin-tests-po-multi-specversion-javax + + org.jvnet.jaxb + jaxb-maven-plugin-tests-po-multi-specversion + 4.0.1-SNAPSHOT + + jar + JAXB Tools :: Maven Plugin :: Test [po-multi-specversion:javax] + + + org.jvnet.jaxb + jaxb-maven-plugin-tests-po-multi-specversion-schema + ${project.version} + + + org.glassfish.jaxb + jaxb-runtime + 2.3.8 + + + jakarta.xml.bind + jakarta.xml.bind-api + 2.3.3 + + + + + + org.jvnet.jaxb + jaxb-maven-plugin + + 2.3 + + + maven:org.jvnet.jaxb:jaxb-maven-plugin-tests-po-multi-specversion-schema!/purchaseorder.xsd + + + true + + + + + diff --git a/maven-plugin/tests/po-multi-specversion/pom.xml b/maven-plugin/tests/po-multi-specversion/pom.xml new file mode 100644 index 000000000..70fb88eb0 --- /dev/null +++ b/maven-plugin/tests/po-multi-specversion/pom.xml @@ -0,0 +1,18 @@ + + 4.0.0 + jaxb-maven-plugin-tests-po-multi-specversion + + org.jvnet.jaxb + jaxb-maven-plugin-tests + 4.0.1-SNAPSHOT + + pom + JAXB Tools :: Maven Plugin :: Test [po-multi-specversion] + Test and sample project to show how to deal with multi-spec-version + (javax and jakarta generation based on same input files) + + schema + javax + jakarta + + diff --git a/maven-plugin/tests/po-multi-specversion/schema/pom.xml b/maven-plugin/tests/po-multi-specversion/schema/pom.xml new file mode 100644 index 000000000..709bd79fe --- /dev/null +++ b/maven-plugin/tests/po-multi-specversion/schema/pom.xml @@ -0,0 +1,11 @@ + + 4.0.0 + jaxb-maven-plugin-tests-po-multi-specversion-schema + + org.jvnet.jaxb + jaxb-maven-plugin-tests-po-multi-specversion + 4.0.1-SNAPSHOT + + jar + JAXB Tools :: Maven Plugin :: Test [po-multi-specversion:schema] + diff --git a/maven-plugin/tests/po-multi-specversion/schema/src/main/resources/purchaseorder.xjb b/maven-plugin/tests/po-multi-specversion/schema/src/main/resources/purchaseorder.xjb new file mode 100644 index 000000000..fe31f999a --- /dev/null +++ b/maven-plugin/tests/po-multi-specversion/schema/src/main/resources/purchaseorder.xjb @@ -0,0 +1,11 @@ + + + + + + diff --git a/maven-plugin/tests/po-2.3/src/main/resources/purchaseorder.xsd b/maven-plugin/tests/po-multi-specversion/schema/src/main/resources/purchaseorder.xsd similarity index 71% rename from maven-plugin/tests/po-2.3/src/main/resources/purchaseorder.xsd rename to maven-plugin/tests/po-multi-specversion/schema/src/main/resources/purchaseorder.xsd index 0d2ab067c..957bddead 100644 --- a/maven-plugin/tests/po-2.3/src/main/resources/purchaseorder.xsd +++ b/maven-plugin/tests/po-multi-specversion/schema/src/main/resources/purchaseorder.xsd @@ -1,9 +1,10 @@ - + - Purchase order schema for Example.com. - Copyright 2000 Example.com. All rights reserved. + Purchase order schema for Example.com. + Copyright 2000 Example.com. All rights reserved. @@ -16,21 +17,20 @@ - + - + - - - + + + - + @@ -46,8 +46,8 @@ - - + + diff --git a/maven-plugin/tests/pom.xml b/maven-plugin/tests/pom.xml index 62997c4a5..d6400d4f9 100644 --- a/maven-plugin/tests/pom.xml +++ b/maven-plugin/tests/pom.xml @@ -33,7 +33,7 @@ issues javadoc p_o - po-2.3 + po-multi-specversion po-scd res tse diff --git a/maven-plugin/tests/res/pom.xml b/maven-plugin/tests/res/pom.xml index a02148068..9ecf63d05 100644 --- a/maven-plugin/tests/res/pom.xml +++ b/maven-plugin/tests/res/pom.xml @@ -15,7 +15,7 @@ org.jvnet.jaxb - jaxb-maven-plugin-tests-po-2.3 + jaxb-maven-plugin-tests-p_o org.jvnet.jaxb @@ -27,7 +27,7 @@ org.jvnet.jaxb - jaxb-maven-plugin-tests-po-2.3 + jaxb-maven-plugin-tests-p_o ${project.version} @@ -66,7 +66,7 @@ org.jvnet.jaxb - jaxb-maven-plugin-tests-po-2.3 + jaxb-maven-plugin-tests-p_o purchaseorder.xsd diff --git a/maven-plugin/tests/res/src/main/resources/bindings.xjb b/maven-plugin/tests/res/src/main/resources/bindings.xjb index 4069fb1eb..a1ffd0090 100644 --- a/maven-plugin/tests/res/src/main/resources/bindings.xjb +++ b/maven-plugin/tests/res/src/main/resources/bindings.xjb @@ -4,7 +4,7 @@ xmlns:jaxb="https://jakarta.ee/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/XMLSchema"> - + diff --git a/maven-plugin/tests/res/src/test/java/org/jvnet/jaxb/maven/tests/res/RunResMojo.java b/maven-plugin/tests/res/src/test/java/org/jvnet/jaxb/maven/tests/res/RunResMojo.java index 0a12d6785..80b33fed7 100644 --- a/maven-plugin/tests/res/src/test/java/org/jvnet/jaxb/maven/tests/res/RunResMojo.java +++ b/maven-plugin/tests/res/src/test/java/org/jvnet/jaxb/maven/tests/res/RunResMojo.java @@ -21,7 +21,7 @@ protected void configureMojo(AbstractXJCMojo mojo) { final DependencyResource purchaseorder_xsd_dependencyResource = new DependencyResource(); purchaseorder_xsd.setDependencyResource(purchaseorder_xsd_dependencyResource); purchaseorder_xsd.getDependencyResource().setGroupId("org.jvnet.jaxb"); - purchaseorder_xsd.getDependencyResource().setArtifactId("jaxb-maven-plugin-tests-po-2.3"); + purchaseorder_xsd.getDependencyResource().setArtifactId("jaxb-maven-plugin-tests-p_o"); purchaseorder_xsd.getDependencyResource().setResource("purchaseorder.xsd"); mojo.setSchemas(new ResourceEntry[]{ purchaseorder_xsd