You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by on...@apache.org on 2017/11/21 18:12:43 UTC

[camel] branch master updated: CAMEL-11942: Switched to jaxb2-maven-plugin for schemagen, instead of using exec-maven-plugin. This fix makes the build succeed on windows. Also applied a work-around for correct schemagen on Java 9.

This is an automated email from the ASF dual-hosted git repository.

onders pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
     new 09f9f32  CAMEL-11942: Switched to jaxb2-maven-plugin for schemagen, instead of using exec-maven-plugin. This fix makes the build succeed on windows. Also applied a work-around for correct schemagen on Java 9.
09f9f32 is described below

commit 09f9f328889cfec6ca6700af074f05408daa88f6
Author: Ioannis Sermetziadis <se...@gmail.com>
AuthorDate: Mon Nov 20 04:04:05 2017 +0200

    CAMEL-11942: Switched to jaxb2-maven-plugin for schemagen, instead of using exec-maven-plugin. This fix makes the build succeed on windows. Also applied a work-around for correct schemagen on Java 9.
---
 components/camel-spring/pom.xml | 109 +++++++++++++---------------------------
 1 file changed, 35 insertions(+), 74 deletions(-)

diff --git a/components/camel-spring/pom.xml b/components/camel-spring/pom.xml
index 83808b0..cbcb8cb 100644
--- a/components/camel-spring/pom.xml
+++ b/components/camel-spring/pom.xml
@@ -274,24 +274,6 @@
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-antrun-plugin</artifactId>
-        <dependencies>
-          <!-- need JAXB on the classpath to use the xjc SchemaGenTask -->
-          <dependency>
-            <groupId>com.sun.xml.bind</groupId>
-            <artifactId>jaxb-core</artifactId>
-            <version>${jaxb-version}</version>
-          </dependency>
-          <dependency>
-            <groupId>com.sun.xml.bind</groupId>
-            <artifactId>jaxb-impl</artifactId>
-            <version>${jaxb-version}</version>
-          </dependency>
-          <dependency>
-            <groupId>com.sun.xml.bind</groupId>
-            <artifactId>jaxb-xjc</artifactId>
-            <version>${jaxb-version}</version>
-          </dependency>
-        </dependencies>
         <executions>
           <execution>
             <id>store-camel-schema-version-in-file</id>
@@ -595,35 +577,13 @@
             <version>1.8</version>
             <executions>
               <execution>
-                <id>generate-schema</id>
-                <phase>process-classes</phase>
-                 <configuration>
-                  <target>
-                    <taskdef resource="net/sf/antcontrib/antcontrib.properties" classpathref="maven.plugin.classpath" />
-                    <path id ="source.files.list">
-                      <fileset dir="${project.build.directory}/schema-src">
-                        <include name="**/*.java" />
-                      </fileset>
-                    </path>
-                    <property name="source.files.property" refid="source.files.list"/>
-                    <propertyregex property="schema.source.formatted" input="${source.files.property}" regexp=":" replace=" " global="true" />
-                    <property name="schema.source.files" value="${schema.source.formatted}"/>
-                    <echo>Schema files ${schema.source.files}</echo>
-                  </target>
-                  <exportAntProperties>true</exportAntProperties>
-                </configuration>
-                <goals>
-                  <goal>run</goal>
-                </goals>
-              </execution>
-              <execution>
                 <id>cpy-schema</id>
                 <phase>process-test-sources</phase>
                 <configuration>
                   <target>
                     <echo>Copying XSD schema to be included in JAR</echo>
-                    <move file="${project.basedir}/schema1.xsd" tofile="${project.build.directory}/schema/camel-spring.xsd" />
-                    <delete file="${project.basedir}/schema2.xsd"/>
+                    <move file="${project.build.directory}/schema/schema1.xsd" tofile="${project.build.directory}/schema/camel-spring.xsd" />
+                    <delete file="${project.build.directory}/schema/schema2.xsd"/>
                   </target>
                 </configuration>
                 <goals>
@@ -634,19 +594,23 @@
           </plugin>
           <plugin>
             <groupId>org.codehaus.mojo</groupId>
-            <artifactId>exec-maven-plugin</artifactId>
+            <artifactId>jaxb2-maven-plugin</artifactId>
+            <version>2.3.1</version>
             <executions>
               <execution>
                 <id>generate schema</id>
                 <phase>generate-test-sources</phase>
                 <goals>
-                  <goal>exec</goal>
+                  <goal>schemagen</goal>
                 </goals>
               </execution>
             </executions>
             <configuration>
-              <executable>schemagen</executable>
-              <commandlineArgs>-cp %classpath ${schema.source.files}</commandlineArgs>
+              <outputDirectory>${project.build.directory}/schema</outputDirectory>
+              <sources>
+                <source>${project.build.directory}/schema-src</source>
+              </sources>
+              <createJavaDocAnnotations>false</createJavaDocAnnotations>
             </configuration>
           </plugin>
         </plugins>
@@ -681,35 +645,16 @@
             <version>1.8</version>
             <executions>
               <execution>
-                <id>list-source-files-for-schema-generation</id>
-                <phase>process-classes</phase>
-                <configuration>
-                  <target>
-                    <taskdef resource="net/sf/antcontrib/antcontrib.properties" classpathref="maven.plugin.classpath" />
-                    <path id ="source.files.list">
-                      <fileset dir="${project.build.directory}/schema-src">
-                        <include name="**/*.java" />
-                      </fileset>
-                    </path>
-                    <property name="source.files.property" refid="source.files.list"/>
-                    <propertyregex property="schema.source.formatted" input="${source.files.property}" regexp=":" replace=" " global="true" />
-                    <property name="schema.source.files" value="${schema.source.formatted}"/>
-                    <echo>Schema files ${schema.source.files}</echo>
-                  </target>
-                  <exportAntProperties>true</exportAntProperties>
-                </configuration>
-                <goals>
-                  <goal>run</goal>
-                </goals>
-              </execution>
-              <execution>
                 <id>cpy-schema</id>
                 <phase>process-test-sources</phase>
                 <configuration>
                   <target>
                     <echo>Copying XSD schema to be included in JAR</echo>
-                    <move file="${project.basedir}/schema1.xsd" tofile="${project.build.directory}/schema/camel-spring.xsd" />
-                    <delete file="${project.basedir}/schema2.xsd"/>
+                    <replace file="${project.build.directory}/schema/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}/schema/schema1.xsd" tofile="${project.build.directory}/schema/camel-spring.xsd" />
+                    <delete file="${project.build.directory}/schema/schema2.xsd"/>
                   </target>
                 </configuration>
                 <goals>
@@ -720,19 +665,35 @@
           </plugin>
           <plugin>
             <groupId>org.codehaus.mojo</groupId>
-            <artifactId>exec-maven-plugin</artifactId>
+            <artifactId>jaxb2-maven-plugin</artifactId>
+            <version>2.3.1</version>
+            <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>
             <executions>
               <execution>
                 <id>generate schema</id>
                 <phase>generate-test-sources</phase>
                 <goals>
-                  <goal>exec</goal>
+                  <goal>schemagen</goal>
                 </goals>
               </execution>
             </executions>
             <configuration>
-              <executable>schemagen</executable>
-              <commandlineArgs>-cp %classpath ${schema.source.files}</commandlineArgs>
+              <outputDirectory>${project.build.directory}/schema</outputDirectory>
+              <sources>
+                <source>${project.build.directory}/schema-src</source>
+              </sources>
+              <createJavaDocAnnotations>false</createJavaDocAnnotations>
             </configuration>
           </plugin>
         </plugins>

-- 
To stop receiving notification emails like this one, please contact
['"commits@camel.apache.org" <co...@camel.apache.org>'].