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

Spaces in Job Name Cause Maven Test Failures for File Input

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • maven-plugin
    • 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.

          [JENKINS-36163] Spaces in Job Name Cause Maven Test Failures for File Input

          S created issue -
          S made changes -
          Description Original: 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)"

          {code}
          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)
          {code}

          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.
          New: 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)"

          {code}
          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)
          {code}

          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.
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 172822 ] New: JNJira + In-Review [ 184794 ]

            Unassigned Unassigned
            signus S
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: