Skip to content

Commit

Permalink
[#443] add test project for multi-specversion
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentschoelens authored and mattrpav committed Nov 22, 2023
1 parent 5b8a6f5 commit bd12b85
Show file tree
Hide file tree
Showing 11 changed files with 147 additions and 19 deletions.
2 changes: 1 addition & 1 deletion maven-plugin/tests/MAVEN_JAXB2_PLUGIN-70/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<schema>
<dependencyResource>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-maven-plugin-tests-po-2.3</artifactId>
<artifactId>jaxb-maven-plugin-tests-p_o</artifactId>
<version>${project.version}</version>
<resource>purchaseorder.xsd</resource>
</dependencyResource>
Expand Down
43 changes: 43 additions & 0 deletions maven-plugin/tests/po-multi-specversion/jakarta/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>jaxb-maven-plugin-tests-po-multi-specversion-jakarta</artifactId>
<parent>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-maven-plugin-tests-po-multi-specversion</artifactId>
<version>4.0.1-SNAPSHOT</version>
</parent>
<packaging>jar</packaging>
<name>JAXB Tools :: Maven Plugin :: Test [po-multi-specversion:jakarta]</name>
<dependencies>
<dependency>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-maven-plugin-tests-po-multi-specversion-schema</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
</dependency>
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-maven-plugin</artifactId>
<configuration>
<specVersion>3.0</specVersion>
<schemas>
<schema>
<url>maven:org.jvnet.jaxb:jaxb-maven-plugin-tests-po-multi-specversion-schema!/purchaseorder.xsd</url>
</schema>
</schemas>
<scanDependenciesForBindings>true</scanDependenciesForBindings>
</configuration>
</plugin>
</plugins>
</build>
</project>
45 changes: 45 additions & 0 deletions maven-plugin/tests/po-multi-specversion/javax/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>jaxb-maven-plugin-tests-po-multi-specversion-javax</artifactId>
<parent>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-maven-plugin-tests-po-multi-specversion</artifactId>
<version>4.0.1-SNAPSHOT</version>
</parent>
<packaging>jar</packaging>
<name>JAXB Tools :: Maven Plugin :: Test [po-multi-specversion:javax]</name>
<dependencies>
<dependency>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-maven-plugin-tests-po-multi-specversion-schema</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.3.8</version>
</dependency>
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>2.3.3</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-maven-plugin</artifactId>
<configuration>
<specVersion>2.3</specVersion>
<schemas>
<schema>
<url>maven:org.jvnet.jaxb:jaxb-maven-plugin-tests-po-multi-specversion-schema!/purchaseorder.xsd</url>
</schema>
</schemas>
<scanDependenciesForBindings>true</scanDependenciesForBindings>
</configuration>
</plugin>
</plugins>
</build>
</project>
18 changes: 18 additions & 0 deletions maven-plugin/tests/po-multi-specversion/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>jaxb-maven-plugin-tests-po-multi-specversion</artifactId>
<parent>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-maven-plugin-tests</artifactId>
<version>4.0.1-SNAPSHOT</version>
</parent>
<packaging>pom</packaging>
<name>JAXB Tools :: Maven Plugin :: Test [po-multi-specversion]</name>
<description>Test and sample project to show how to deal with multi-spec-version
(javax and jakarta generation based on same input files)</description>
<modules>
<module>schema</module>
<module>javax</module>
<module>jakarta</module>
</modules>
</project>
11 changes: 11 additions & 0 deletions maven-plugin/tests/po-multi-specversion/schema/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>jaxb-maven-plugin-tests-po-multi-specversion-schema</artifactId>
<parent>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-maven-plugin-tests-po-multi-specversion</artifactId>
<version>4.0.1-SNAPSHOT</version>
</parent>
<packaging>jar</packaging>
<name>JAXB Tools :: Maven Plugin :: Test [po-multi-specversion:schema]</name>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<jxb:bindings
xmlns:jxb="https://jakarta.ee/xml/ns/jaxb"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
jxb:extensionBindingPrefixes="xjc"
jxb:version="3.0">
<jxb:globalBindings>
<xjc:simple/>
</jxb:globalBindings>
</jxb:bindings>
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:jaxb="https://jakarta.ee/xml/ns/jaxb" jaxb:version="3.0">

<xsd:annotation>
<xsd:documentation xml:lang="en">
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.
</xsd:documentation>
</xsd:annotation>

Expand All @@ -16,21 +17,20 @@
<xsd:element name="shipTo" type="USAddress"/>
<xsd:element name="billTo" type="USAddress"/>
<xsd:element ref="comment" minOccurs="0"/>
<xsd:element name="items" type="Items"/>
<xsd:element name="items" type="Items"/>
</xsd:sequence>
<xsd:attribute name="orderDate" type="xsd:date"/>
</xsd:complexType>

<xsd:complexType name="USAddress">
<xsd:sequence>
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="street" type="xsd:string"/>
<xsd:element name="city" type="xsd:string"/>
<xsd:element name="state" type="xsd:string"/>
<xsd:element name="zip" type="xsd:decimal"/>
<xsd:element name="city" type="xsd:string"/>
<xsd:element name="state" type="xsd:string"/>
<xsd:element name="zip" type="xsd:decimal"/>
</xsd:sequence>
<xsd:attribute name="country" type="xsd:NMTOKEN"
fixed="US"/>
<xsd:attribute name="country" type="xsd:NMTOKEN" fixed="US"/>
</xsd:complexType>

<xsd:complexType name="Items">
Expand All @@ -46,8 +46,8 @@
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="USPrice" type="xsd:decimal"/>
<xsd:element ref="comment" minOccurs="0"/>
<xsd:element name="USPrice" type="xsd:decimal"/>
<xsd:element ref="comment" minOccurs="0"/>
<xsd:element name="shipDate" type="xsd:date" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="partNum" type="SKU" use="required"/>
Expand Down
2 changes: 1 addition & 1 deletion maven-plugin/tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<module>issues</module>
<module>javadoc</module>
<module>p_o</module>
<module>po-2.3</module>
<module>po-multi-specversion</module>
<module>po-scd</module>
<module>res</module>
<module>tse</module>
Expand Down
6 changes: 3 additions & 3 deletions maven-plugin/tests/res/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</dependency>
<dependency>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-maven-plugin-tests-po-2.3</artifactId>
<artifactId>jaxb-maven-plugin-tests-p_o</artifactId>
</dependency>
<dependency>
<groupId>org.jvnet.jaxb</groupId>
Expand All @@ -27,7 +27,7 @@
<dependencies>
<dependency>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-maven-plugin-tests-po-2.3</artifactId>
<artifactId>jaxb-maven-plugin-tests-p_o</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
Expand Down Expand Up @@ -66,7 +66,7 @@
<schema>
<dependencyResource>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-maven-plugin-tests-po-2.3</artifactId>
<artifactId>jaxb-maven-plugin-tests-p_o</artifactId>
<!-- Can be defined in project dependencies or dependency management -->
<!--version>${project.version}</version-->
<resource>purchaseorder.xsd</resource>
Expand Down
2 changes: 1 addition & 1 deletion maven-plugin/tests/res/src/main/resources/bindings.xjb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns:jaxb="https://jakarta.ee/xml/ns/jaxb"
xmlns:xs="http://www.w3.org/2001/XMLSchema">

<jaxb:bindings schemaLocation="maven:org.jvnet.jaxb:jaxb-maven-plugin-tests-po-2.3:jar::!/purchaseorder.xsd" node="/xs:schema">
<jaxb:bindings schemaLocation="maven:org.jvnet.jaxb:jaxb-maven-plugin-tests-p_o:jar::!/purchaseorder.xsd" node="/xs:schema">
<!--jaxb:schemaBindings>
<jaxb:package name="org.jvnet.jaxb.tests.po"/>
</jaxb:schemaBindings-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ protected void configureMojo(AbstractXJCMojo<Options> 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
Expand Down

0 comments on commit bd12b85

Please sign in to comment.