Skip to content

Commit 7089915

Browse files
authored
Added jdk9 jaxb build option (#572)
1 parent 5882fd5 commit 7089915

File tree

2 files changed

+107
-25
lines changed

2 files changed

+107
-25
lines changed

core/pom.xml

Lines changed: 101 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -277,31 +277,6 @@
277277
</execution>
278278
</executions>
279279
</plugin>
280-
<plugin>
281-
<groupId>org.codehaus.mojo</groupId>
282-
<artifactId>jaxb2-maven-plugin</artifactId>
283-
<executions>
284-
<execution>
285-
<id>schemagen</id>
286-
<phase>generate-resources</phase>
287-
<goals>
288-
<goal>schemagen</goal>
289-
</goals>
290-
<configuration>
291-
<workDirectory>${project.build.directory}/generated-resources/schemagen</workDirectory>
292-
<includes>
293-
org/dozer/builder/model/jaxb/**
294-
</includes>
295-
<transformSchemas>
296-
<transformSchema>
297-
<uri>http://dozermapper.github.io/schema/bean-mapping</uri>
298-
<toFile>bean-mapping.xsd</toFile>
299-
</transformSchema>
300-
</transformSchemas>
301-
</configuration>
302-
</execution>
303-
</executions>
304-
</plugin>
305280
<plugin>
306281
<groupId>org.codehaus.mojo</groupId>
307282
<artifactId>xmlbeans-maven-plugin</artifactId>
@@ -321,4 +296,105 @@
321296
</plugins>
322297
</build>
323298

299+
<profiles>
300+
<profile>
301+
<id>jdk8-build</id>
302+
<activation>
303+
<jdk>1.8</jdk>
304+
</activation>
305+
<build>
306+
<plugins>
307+
<plugin>
308+
<groupId>org.codehaus.mojo</groupId>
309+
<artifactId>jaxb2-maven-plugin</artifactId>
310+
<executions>
311+
<execution>
312+
<id>schemagen</id>
313+
<phase>generate-resources</phase>
314+
<goals>
315+
<goal>schemagen</goal>
316+
</goals>
317+
<configuration>
318+
<workDirectory>${project.build.directory}/generated-resources/schemagen</workDirectory>
319+
<includes>
320+
org/dozer/builder/model/jaxb/**
321+
</includes>
322+
<transformSchemas>
323+
<transformSchema>
324+
<uri>http://dozermapper.github.io/schema/bean-mapping</uri>
325+
<toFile>bean-mapping.xsd</toFile>
326+
</transformSchema>
327+
</transformSchemas>
328+
</configuration>
329+
</execution>
330+
</executions>
331+
</plugin>
332+
</plugins>
333+
</build>
334+
</profile>
335+
<profile>
336+
<id>jdk9-build</id>
337+
<activation>
338+
<jdk>9</jdk>
339+
</activation>
340+
<build>
341+
<plugins>
342+
<plugin>
343+
<groupId>org.codehaus.mojo</groupId>
344+
<artifactId>jaxb2-maven-plugin</artifactId>
345+
<executions>
346+
<execution>
347+
<id>schemagen</id>
348+
<phase>generate-resources</phase>
349+
<goals>
350+
<goal>schemagen</goal>
351+
</goals>
352+
<configuration>
353+
<workDirectory>${project.build.directory}/generated-resources/schemagen</workDirectory>
354+
<includes>
355+
org/dozer/builder/model/jaxb/**
356+
</includes>
357+
</configuration>
358+
</execution>
359+
</executions>
360+
<dependencies>
361+
<dependency>
362+
<groupId>org.glassfish.jaxb</groupId>
363+
<artifactId>jaxb-jxc-jdk9</artifactId>
364+
<version>2.3.0</version>
365+
</dependency>
366+
<dependency>
367+
<groupId>javax.activation</groupId>
368+
<artifactId>javax.activation-api</artifactId>
369+
<version>1.2.0</version>
370+
</dependency>
371+
</dependencies>
372+
</plugin>
373+
<plugin>
374+
<groupId>org.apache.maven.plugins</groupId>
375+
<artifactId>maven-antrun-plugin</artifactId>
376+
<executions>
377+
<execution>
378+
<id>copy-schema</id>
379+
<phase>generate-resources</phase>
380+
<configuration>
381+
<target>
382+
<echo>Copying XSD schema to be included in JAR</echo>
383+
<replace file="${project.build.directory}/generated-resources/schemagen/schema1.xsd"
384+
token="xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot;"
385+
value="xmlns=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot;"/>
386+
<move file="${project.build.directory}/generated-resources/schemagen/schema1.xsd"
387+
tofile="${project.build.directory}/generated-resources/schemagen/bean-mapping.xsd"/>
388+
</target>
389+
</configuration>
390+
<goals>
391+
<goal>run</goal>
392+
</goals>
393+
</execution>
394+
</executions>
395+
</plugin>
396+
</plugins>
397+
</build>
398+
</profile>
399+
</profiles>
324400
</project>

plugins-parent/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
<properties>
3636
<!-- Maven Plugins versions; alphabetical order -->
3737
<alta-maven-plugin.version>0.6.1</alta-maven-plugin.version>
38+
<maven-antrun-plugin.version>1.8</maven-antrun-plugin.version>
3839
<maven-checkstyle-plugin.version>2.17</maven-checkstyle-plugin.version>
3940
<maven-clean-plugin.version>3.0.0</maven-clean-plugin.version>
4041
<maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
@@ -135,6 +136,11 @@
135136
<artifactId>alta-maven-plugin</artifactId>
136137
<version>${alta-maven-plugin.version}</version>
137138
</plugin>
139+
<plugin>
140+
<groupId>org.apache.maven.plugins</groupId>
141+
<artifactId>maven-antrun-plugin</artifactId>
142+
<version>${maven-antrun-plugin.version}</version>
143+
</plugin>
138144
<plugin>
139145
<groupId>org.apache.maven.plugins</groupId>
140146
<artifactId>maven-checkstyle-plugin</artifactId>

0 commit comments

Comments
 (0)