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 email (DEV)"
java.nio.file.NoSuchFileException: /var/lib/jenkins/jobs/foldername/jobs/KEY%20(3)%20-%20Package%20email%20(DEV)/workspace/email/target/test-classes/data/TextEmail.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 email (DEV)/workspace/email/target/test-classes/data/TextEmail.txt Workaround: Change the job name to "KEY3PackageEmailDEV" removing all spaces allows the tests to locate the appropriate filepaths correctly - and the tests can be run without errors. |