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

Mix of Win-style and Linux-style file path separators used in pipeline script run from docker image jenkins/jenkins:jdk11

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Critical Critical
    • docker, pipeline
    • None

      I'm running a Jenkins pipeline job from a docker container originating from dockerhub image jenkins/jenkins:jdk11. The container is executed on a Win10 host using the most recent Win docker desktop.

      The job fails with error message:

      }}{{
      {{[INFO] }}
      [INFO] -------------------------------------------------------
      [INFO] T E S T S
      [INFO] -------------------------------------------------------
      [INFO] Running TestSuite
      java.io.FileNotFoundException: /var/jenkins_home/workspace/Quarkus-Todo-TA-noBDD\src\main\resources\properties\object.properties (No such file or directory)
      {{ at java.base/java.io.FileInputStream.open0(Native Method)}}
      {{ at java.base/java.io.FileInputStream.open(FileInputStream.java:219)}}
      {{ at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)}}

      As can be seen, the error is caused by a mixed usage of Win-stype and Linux-stype file path separators. The issue doesn't arise in a native Win installation of Jenkins.

      This is the relevant part of the pipeline:

      pipeline {

      agent any

      stages{
      {{ stage('Clean workspace (mvn clean)') {}}
      {{ steps {}}
      {{ sh 'mvn -f pom.xml clean'}}
      {{ }}}
      {{ }}}
      {{ stage('Run TestNG tests and create deployment package (mvn package)') {}}
      {{ steps {}}
      {{ sh 'mvn -f pom.xml -Dexec.args=\"-reporter org.testng.reporters.XMLReporter:generateTestResultAttributes=true,generateGroupsAttribute=true -outputDirectory=FirstTestautomation/target/surefire-reports -useDefaultListeners false\" -Dmaven.test.failure.ignore=true compile install'}}
      {{ }}}
      {{ }}}

      ...

      Please find attached the full console output and the configuration of the dockered Jenkins.

      Is there a way to fix this?

      Kind regards

      – Frank Bergemann

            csanchez Carlos Sanchez
            frank_bergemann Frank Bergemann
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: