Skip to content
Open
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
1 change: 1 addition & 0 deletions maven-plugin/tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
<module>jt-306</module>
<module>jt-40</module>
<module>wsdl-file</module>
<module>xsd-as-library</module>
</modules>
<build>
<plugins>
Expand Down
41 changes: 41 additions & 0 deletions maven-plugin/tests/xsd-as-library/app/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<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>
<parent>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-maven-plugin-tests-xsd-as-library</artifactId>
<version>4.1.0-SNAPSHOT</version>
</parent>
<artifactId>jaxb-maven-plugin-tests-xsd-as-library-app</artifactId>
<name>JAXB Tools :: Maven Plugin :: Test [xsd-as-library:app]</name>

<build>
<plugins>
<plugin>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-maven-plugin</artifactId>
<executions>
<execution>
<id>generate</id>
<goals>
<goal>generate</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<schemas>
<schema>
<dependencyResource>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-maven-plugin-tests-xsd-as-library-xsds</artifactId>
<version>${project.version}</version>
<resource>xsd/*.xsd</resource>
</dependencyResource>
</schema>
</schemas>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package org.jvnet.jaxb.main;

import io.spring.guides.gs_producing_web_service.Country;

public class CountryHolder {

public static Country createCountry() {
return new Country();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package org.jvnet.jaxb.test;

import io.spring.guides.gs_producing_web_service.Country;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.jvnet.jaxb.main.CountryHolder;

class CountryHolderTest {

@Test
void createCountryTest() {

// when
Country country = CountryHolder.createCountry();

// then
Assertions.assertNotNull(country);
}

}
19 changes: 19 additions & 0 deletions maven-plugin/tests/xsd-as-library/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<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>
<parent>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-maven-plugin-tests</artifactId>
<version>4.1.0-SNAPSHOT</version>
</parent>
<artifactId>jaxb-maven-plugin-tests-xsd-as-library</artifactId>
<packaging>pom</packaging>
<name>JAXB Tools :: Maven Plugin :: Test [xsd-as-library]</name>
<description>Test and sample project to show how to generate classes from XSDs located in a module part of the same
Maven project
</description>
<modules>
<module>app</module>
<module>xsds</module>
</modules>
</project>
11 changes: 11 additions & 0 deletions maven-plugin/tests/xsd-as-library/xsds/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>
<parent>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-maven-plugin-tests-xsd-as-library</artifactId>
<version>4.1.0-SNAPSHOT</version>
</parent>
<artifactId>jaxb-maven-plugin-tests-xsd-as-library-xsds</artifactId>
<name>JAXB Tools :: Maven Plugin :: Test [xsd-as-library:xsds]</name>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="https://spring.io/guides/gs-producing-web-service"
targetNamespace="https://spring.io/guides/gs-producing-web-service" elementFormDefault="qualified">

<xs:element name="getCountryRequest">
<xs:complexType>
<xs:sequence>
<xs:element name="name" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>

<xs:element name="getCountryResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="country" type="tns:country"/>
</xs:sequence>
</xs:complexType>
</xs:element>

<xs:complexType name="country">
<xs:sequence>
<xs:element name="name" type="xs:string"/>
<xs:element name="population" type="xs:int"/>
<xs:element name="capital" type="xs:string"/>
<xs:element name="currency" type="tns:currency"/>
</xs:sequence>
</xs:complexType>

<xs:simpleType name="currency">
<xs:restriction base="xs:string">
<xs:enumeration value="GBP"/>
<xs:enumeration value="EUR"/>
<xs:enumeration value="PLN"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>