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

Handle jobs in Multibranch projects where git branches have special characters

XMLWordPrintable

      I'm using 2.19, with pipeline-plugin 2.2.

      I have a git repo with a java and maven project in it. This project has some tests that use the following code to read a file:

      new File(this.getClass().getResource("/myfolder/" + filename).getPath())
      

      For that repo, I have a multibranch-project where I have a branch named feature/hahahah, with a slash in it. I use a Jenkinsfile in the repo to build from.

      When a job is created for this branch, the build fails with the following error:

      java.lang.RuntimeException: java.io.FileNotFoundException: /u01/jenkins/workspace/myproject-multibranch/feature%252Fhahahah/prognose/target/test-classes/myfolder/testfile.xml (No such file or directory)
      	at ske.fastsetting.skatt.prognose.fra.fil.PrognoseFraFilTest.lesFil(PrognoseFraFilTest.java:172)
      	at ske.fastsetting.skatt.prognose.fra.fil.PrognoseFraFilTest.skalleseGrunnlagFraFilOgPrognostisere(PrognoseFraFilTest.java:122)
      

      Is there a way to create the workspace in a folder without %252F?

            mjdetullio Matthew DeTullio
            andersem Anders Emil Salvesen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: