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. 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? |