[ 
https://issues.apache.org/jira/browse/CAMEL-11942?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16261200#comment-16261200
 ] 

ASF GitHub Bot commented on CAMEL-11942:
----------------------------------------

onders86 closed pull request #2099: CAMEL-11942: Switched to jaxb2-maven-plugin 
for camel-spring schemagen
URL: https://github.com/apache/camel/pull/2099
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/components/camel-spring/pom.xml b/components/camel-spring/pom.xml
index 83808b056a5..cbcb8cbe8aa 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>
@@ -594,36 +576,14 @@
             <artifactId>maven-antrun-plugin</artifactId>
             <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>
@@ -680,36 +644,17 @@
             <artifactId>maven-antrun-plugin</artifactId>
             <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>


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> camel-spring build failure on windows
> -------------------------------------
>
>                 Key: CAMEL-11942
>                 URL: https://issues.apache.org/jira/browse/CAMEL-11942
>             Project: Camel
>          Issue Type: Task
>          Components: build system
>    Affects Versions: 2.20.0
>            Reporter: Önder Sezgin
>            Priority: Minor
>             Fix For: 2.21.0
>
>
> [INFO] Executed tasks
> [INFO]
> [INFO] --- exec-maven-plugin:1.1.1:exec (generate schema) @ camel-spring ---
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Total time: 03:33 min
> [INFO] Finished at: 2017-10-24T10:27:33+03:00
> [INFO] Final Memory: 37M/240M
> [INFO] 
> ------------------------------------------------------------------------
> [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.1.1:exec 
> (g
> enerate schema) on project camel-spring: Command execution failed. Error 
> while e
> xecuting process. Cannot run program "cmd.exe" (in directory 
> "D:\dev\github\came
> l\components\camel-spring"): CreateProcess error=206, The filename or 
> extension
> is too long -> [Help 1]
> [ERROR]



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to