Skip to content

Commit

Permalink
Added jdk9 jaxb build option (#572)
Browse files Browse the repository at this point in the history
  • Loading branch information
garethahealy authored Apr 1, 2018
1 parent 5882fd5 commit 7089915
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 25 deletions.
126 changes: 101 additions & 25 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -277,31 +277,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<executions>
<execution>
<id>schemagen</id>
<phase>generate-resources</phase>
<goals>
<goal>schemagen</goal>
</goals>
<configuration>
<workDirectory>${project.build.directory}/generated-resources/schemagen</workDirectory>
<includes>
org/dozer/builder/model/jaxb/**
</includes>
<transformSchemas>
<transformSchema>
<uri>http://dozermapper.github.io/schema/bean-mapping</uri>
<toFile>bean-mapping.xsd</toFile>
</transformSchema>
</transformSchemas>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>xmlbeans-maven-plugin</artifactId>
Expand All @@ -321,4 +296,105 @@
</plugins>
</build>

<profiles>
<profile>
<id>jdk8-build</id>
<activation>
<jdk>1.8</jdk>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<executions>
<execution>
<id>schemagen</id>
<phase>generate-resources</phase>
<goals>
<goal>schemagen</goal>
</goals>
<configuration>
<workDirectory>${project.build.directory}/generated-resources/schemagen</workDirectory>
<includes>
org/dozer/builder/model/jaxb/**
</includes>
<transformSchemas>
<transformSchema>
<uri>http://dozermapper.github.io/schema/bean-mapping</uri>
<toFile>bean-mapping.xsd</toFile>
</transformSchema>
</transformSchemas>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>jdk9-build</id>
<activation>
<jdk>9</jdk>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<executions>
<execution>
<id>schemagen</id>
<phase>generate-resources</phase>
<goals>
<goal>schemagen</goal>
</goals>
<configuration>
<workDirectory>${project.build.directory}/generated-resources/schemagen</workDirectory>
<includes>
org/dozer/builder/model/jaxb/**
</includes>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-jxc-jdk9</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>javax.activation-api</artifactId>
<version>1.2.0</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>copy-schema</id>
<phase>generate-resources</phase>
<configuration>
<target>
<echo>Copying XSD schema to be included in JAR</echo>
<replace file="${project.build.directory}/generated-resources/schemagen/schema1.xsd"
token="xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot;"
value="xmlns=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot;"/>
<move file="${project.build.directory}/generated-resources/schemagen/schema1.xsd"
tofile="${project.build.directory}/generated-resources/schemagen/bean-mapping.xsd"/>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
6 changes: 6 additions & 0 deletions plugins-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<properties>
<!-- Maven Plugins versions; alphabetical order -->
<alta-maven-plugin.version>0.6.1</alta-maven-plugin.version>
<maven-antrun-plugin.version>1.8</maven-antrun-plugin.version>
<maven-checkstyle-plugin.version>2.17</maven-checkstyle-plugin.version>
<maven-clean-plugin.version>3.0.0</maven-clean-plugin.version>
<maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
Expand Down Expand Up @@ -135,6 +136,11 @@
<artifactId>alta-maven-plugin</artifactId>
<version>${alta-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>${maven-antrun-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
Expand Down

0 comments on commit 7089915

Please sign in to comment.