Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-56829

Wrong basedir calculation during Jenkins maven build with jaxb2-maven-plugin

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Major Major
    • maven-plugin
    • jenkins docker version 2.164.1
      Jenkins Maven plugin 1.23
      Maven toolchain version 3.5.2
      Maven toolchain version 3.6.0
      jaxb2-maven-plugin 2.3.1 and 2.4

      Hi,

      We experienced a strange behavior during a maven build using a Jenkins Maven Job where the basedir path is not correctly calculated.

      The Jenkins infrastructure is distrubuited and the slave is a linux virtual machine.

      In particular we have a super pom that invoke a lot of sub poms and one of this has the following configuration related to the jaxb2-maven-plugin

       

       

       

      // code placeholder
      <artifactId>jaxb2-maven-plugin</artifactId>
       <version>2.4</version>
       <executions>
               <execution>
                       <phase>generate-sources</phase>
                       <id>xjc</id>
                       <goals>
                               <goal>xjc</goal>
                       </goals>
               </execution>
       </executions>
       <configuration>
               <!-- The package of your generated sources -->
               <packageName>com.company.flow.customview</packageName>
               <sources>
                       <source>src/main/resources/xsd</source>
               </sources>
       </configuration>
      
      
      

       

       

      the error with  jaxb2-maven-plugin:2.4 is the following:

       

      // 
      
       [INFO] --- jaxb2-maven-plugin:2.4:xjc (xjc) @ com.company.flow.customview --- 
      [INFO] Created EpisodePath [/home/jenkins/workspace/DEV/flow/DEV/01-SRV/flow-cf-bl/Baseline/services/com.company.flow.customview/target/generated-sources/jaxb/META-INF/JAXB]: true 
      [INFO] Ignored given or default xjbSources [/home/jenkins/workspace/DEV/flow/DEV/01-SRV/flow-cf-bl/Baseline/services/com.company.flow.customview/src/main/xjb], since it is not an existent file or directory. 
      [INFO] Created EpisodePath [/home/jenkins/workspace/DEV/flow/DEV/01-SRV/flow-cf-bl/Baseline/services/com.company.flow.customview/target/generated-sources/jaxb/META-INF/JAXB]: true 
      [ERROR] null [-1,-1] org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'file:/home/jenkins/workspace/DEV/flow/DEV/01-SRV/flow-cf-bl/Baseline/services/com.company.flow/.customview/src/main/resources/xsd/CustomViewDefinition.xsd',
      

       

       

      using jaxb2-maven-plugin:2.3.1 the error is

       

      // 
       [INFO] --- jaxb2-maven-plugin:2.3.1:xjc (xjc) @ com.company.flow.customview --- 
      [INFO] Created EpisodePath [/home/jenkins/workspace/DEV/flow/DEV/01-SRV/flow-cf-bl/Baseline/services/com.company.flow.customview/target/generated-sources/jaxb/META-INF/JAXB]: true 
      [INFO] Ignored given or default xjbSources [/home/jenkins/workspace/DEV/flow/DEV/01-SRV/flow-cf-bl/Baseline/services/com.company.flow.customview/src/main/xjb], since it is not an existent file or directory. 
      [ERROR] null [-1,-1] org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'file:/home/jenkins/workspace/DEV/flow/DEV/01-SRV/flow-cf-bl/Baseline/services/com.company.flow/customview/src/main/resources/xsd/CustomViewDefinition.xsd',
      

       

      If we run the maven build locally everithing works without issues.
      Can you help us?

       

       

      Thank you.

       

          [JENKINS-56829] Wrong basedir calculation during Jenkins maven build with jaxb2-maven-plugin

          Pietro Pepe created issue -
          Pietro Pepe made changes -
          Description Original: Hi,

          We experienced a strange behavior during a maven build using a Jenkins Maven Job where the basedir path is not correctly calculated.

          The Jenkins infrastructure is distrubuited and the slave is a linux virtual machine.

           In particular we have a super pom that invoke a lot of sub poms and one of this has the following configuration related to the {color:#333333}*jaxb2-maven-plugin* {color}

           

           

           
          {code:java}
          // code placeholder
          <artifactId>jaxb2-maven-plugin</artifactId>
           <version>2.4</version>
           <executions>
                   <execution>
                           <phase>generate-sources</phase>
                           <id>xjc</id>
                           <goals>
                                   <goal>xjc</goal>
                           </goals>
                   </execution>
           </executions>
           <configuration>
                   <!-- The package of your generated sources -->
                   <packageName>com.company.flow.customview</packageName>
                   <sources>
                           <source>src/main/resources/xsd</source>
                   </sources>
           </configuration>


          {code}
           

           

          {color:#333333}the error with {color:#172b4d} {color}*{color:#333333}jaxb2-maven-plugin:2.4{color}* is the following:{color}

           
          {code:java}
          //

           [INFO] --- jaxb2-maven-plugin:2.4:xjc (xjc) @ com.company.flow.customview ---
          [INFO] Created EpisodePath [/home/jenkins/workspace/DEV/flow/DEV/01-SRV/flow-cf-bl/Baseline/services/com.company.flow.customview/target/generated-sources/jaxb/META-INF/JAXB]: true
          [INFO] Ignored given or default xjbSources [/home/jenkins/workspace/DEV/flow/DEV/01-SRV/flow-cf-bl/Baseline/services/com.company.flow.customview/src/main/xjb], since it is not an existent file or directory.
          [INFO] Created EpisodePath [/home/jenkins/workspace/DEV/flow/DEV/01-SRV/flow-cf-bl/Baseline/services/com.company.flow.customview/target/generated-sources/jaxb/META-INF/JAXB]: true
          [ERROR] null [-1,-1] org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'file:/home/jenkins/workspace/DEV/flow/DEV/01-SRV/flow-cf-bl/Baseline/services/com.company.flow/.customview/src/main/resources/xsd/CustomViewDefinition.xsd',
          {code}
           

           

          using {color:#333333}*{color:#333333}jaxb2-maven-plugin:2.3.1{color}* the error is{color}

           
          {code:java}
          //
           [INFO] --- jaxb2-maven-plugin:2.3.1:xjc (xjc) @ com.company.flow.customview ---
          [INFO] Created EpisodePath [/home/jenkins/workspace/DEV/flow/DEV/01-SRV/flow-cf-bl/Baseline/services/com.company.flow.customview/target/generated-sources/jaxb/META-INF/JAXB]: true
          [INFO] Ignored given or default xjbSources [/home/jenkins/workspace/DEV/flow/DEV/01-SRV/flow-cf-bl/Baseline/services/com.company.flow.customview/src/main/xjb], since it is not an existent file or directory.
          [ERROR] null [-1,-1] org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'file:/home/jenkins/workspace/DEV/flow/DEV/01-SRV/flow-cf-bl/Baseline/services/com.company.flow/customview/src/main/resources/xsd/CustomViewDefinition.xsd',
          {code}
           

          {color:#333333}If we run the maven build locally everithing works without issues.
          Can you help up?
          {color}

           

          {color:#333333}Thank you.{color}

           
          New: Hi,

          We experienced a strange behavior during a maven build using a Jenkins Maven Job where the basedir path is not correctly calculated.

          The Jenkins infrastructure is distrubuited and the slave is a linux virtual machine.

          In particular we have a super pom that invoke a lot of sub poms and one of this has the following configuration related to the {color:#333333}*jaxb2-maven-plugin* {color}

           

           

           
          {code:java}
          // code placeholder
          <artifactId>jaxb2-maven-plugin</artifactId>
           <version>2.4</version>
           <executions>
                   <execution>
                           <phase>generate-sources</phase>
                           <id>xjc</id>
                           <goals>
                                   <goal>xjc</goal>
                           </goals>
                   </execution>
           </executions>
           <configuration>
                   <!-- The package of your generated sources -->
                   <packageName>com.company.flow.customview</packageName>
                   <sources>
                           <source>src/main/resources/xsd</source>
                   </sources>
           </configuration>


          {code}
           

           

          {color:#333333}the error with  {color}*{color:#333333}jaxb2-maven-plugin:2.4{color}* is the following:
           
            
          {code:java}
          //

           [INFO] --- jaxb2-maven-plugin:2.4:xjc (xjc) @ com.company.flow.customview ---
          [INFO] Created EpisodePath [/home/jenkins/workspace/DEV/flow/DEV/01-SRV/flow-cf-bl/Baseline/services/com.company.flow.customview/target/generated-sources/jaxb/META-INF/JAXB]: true
          [INFO] Ignored given or default xjbSources [/home/jenkins/workspace/DEV/flow/DEV/01-SRV/flow-cf-bl/Baseline/services/com.company.flow.customview/src/main/xjb], since it is not an existent file or directory.
          [INFO] Created EpisodePath [/home/jenkins/workspace/DEV/flow/DEV/01-SRV/flow-cf-bl/Baseline/services/com.company.flow.customview/target/generated-sources/jaxb/META-INF/JAXB]: true
          [ERROR] null [-1,-1] org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'file:/home/jenkins/workspace/DEV/flow/DEV/01-SRV/flow-cf-bl/Baseline/services/com.company.flow/.customview/src/main/resources/xsd/CustomViewDefinition.xsd',
          {code}

            
           
            
           
           using *jaxb2-maven-plugin:2.3.1* the error is
           
            
          {code:java}
          //
           [INFO] --- jaxb2-maven-plugin:2.3.1:xjc (xjc) @ com.company.flow.customview ---
          [INFO] Created EpisodePath [/home/jenkins/workspace/DEV/flow/DEV/01-SRV/flow-cf-bl/Baseline/services/com.company.flow.customview/target/generated-sources/jaxb/META-INF/JAXB]: true
          [INFO] Ignored given or default xjbSources [/home/jenkins/workspace/DEV/flow/DEV/01-SRV/flow-cf-bl/Baseline/services/com.company.flow.customview/src/main/xjb], since it is not an existent file or directory.
          [ERROR] null [-1,-1] org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'file:/home/jenkins/workspace/DEV/flow/DEV/01-SRV/flow-cf-bl/Baseline/services/com.company.flow/customview/src/main/resources/xsd/CustomViewDefinition.xsd',
          {code}

            
           
           If we run the maven build locally everithing works without issues.
           Can you help us?

           

           

          {color:#333333}Thank you.{color}

           
          Olivier Lamy made changes -
          Assignee New: Olivier Lamy [ olamy ]
          Resolution New: Not A Defect [ 7 ]
          Status Original: Open [ 1 ] New: Closed [ 6 ]

            olamy Olivier Lamy
            ppepe Pietro Pepe
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: