-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
Jenkins 2.10, CentOS 7 x64, OpenJDK 1.8
Issue set as minor due to available workaround.
Problem:
Where maven job names have spaces and files are used within the workspace, Jenkins cannot locate the file in the workspace because the url-encoded values do not match the literal value of the path on the host.
Job name: "KEY (3) - Package app (DEV)"
java.nio.file.NoSuchFileException: /var/lib/jenkins/jobs/foldername/jobs/KEY%20(3)%20-%20Package%20app%20(DEV)/workspace/email/target/test-classes/data/TestText.txt
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
at java.nio.file.Files.newByteChannel(Files.java:317)
at java.nio.file.Files.newByteChannel(Files.java:363)
at java.nio.file.Files.readAllBytes(Files.java:2981)
at com.company.a.e.ParserTest.setUp(ParserTest.java:50)
Where the file is validated and the literal path is /var/lib/jenkins/jobs/foldername/jobs/KEY (3) - Package app (DEV)/workspace/email/target/test-classes/data/TextTest.txt
Workaround:
Change the job name to "KEY3PackageAppDEV" removing all spaces allows the tests to locate the appropriate filepaths correctly - and the tests can be run without errors.