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

Build issues when folder name (or job name) contains spaces

      When you create a folder with spaces in the name, and then add a Maven job to it, in some cases the build will fail (e.g. when the Maven project uses plugins to generate sources, such as the jaxws-maven-plugin) because Maven calls a command that is incorrectly parsed by the shell because of spaces in the path.
      What I would suggest is that the underlying directory for a Folder be created using a numerical name rather than the name of the folder entered in the Jenkins UI. This would prevent any issues with spaces or other special characters used in the folder name, plus it would help shorten the directory paths as well. I reckon the easiest way to generate the directory name for the folder would be to calculate the SHA1 or MD5 hash for the folder name and use that as a the 'physical' underlying directory name.
      The Jenkins UI would go on displaying the 'logical' folder name asc usual, but should also indicate the associated 'physical' underlying directory name associated to the folder so that administrators could know where to locate the folder under the jobs/ subdirectory.

      Note that is issue is not specific to Folders in Jenkins, it also affects Jobs since the directory created for a job is based on the job name as well... So really this issue should be treated both at the folder and job level I suppose...

      (Also note that other build systems such as Continuum are not affected by this problem precisely because they use sequential numbers for creating build directories instead of using the name of the project or the project group).

      Of course, the easy workaround is NOT to use spaces in job or folder names but then it's a bit limitative not to be able to name jobs/folders as you wish and uses spaces or other special characters to enhance legibility..

      Just my humnle opinion...

      Regards
      Laurent

      PS - Edited to add affected components: "maven", "core", "cloudbees-folder" – please feel free to change affected components since I'm not sure these are the right categories to use

          [JENKINS-20600] Build issues when folder name (or job name) contains spaces

          Laurent Denanot created issue -
          Laurent Denanot made changes -
          Component/s New: cloudbees-folder [ 18137 ]
          Component/s New: core [ 15593 ]
          Description Original: When you create a folder with spaces in the name, and then add a Maven job to it, in some cases the build will fail (e.g. when the Maven project uses plugins to generate sources, such as the jaxws-maven-plugin) because Maven calls a command that is incorrectly parsed by the shell because of spaces in the path.
          What I would suggest is that the underlying directory for a Folder be created using a numerical name rather than the name of the folder entered in the Jenkins UI. This would prevent any issues with spaces or other special characters used in the folder name, plus it would help shorten the directory paths as well. I reckon the easiest way to generate the directory name for the folder would be to calculate the SHA1 or MD5 hash for the folder name and use that as a the 'physical' underlying directory name.
          The Jenkins UI would go on displaying the 'logical' folder name asc usual, but should also indicate the associated 'physical' underlying directory name associated to the folder so that administrators could know where to locate the folder under the jobs/ subdirectory.

          Note that is issue is not specific to Folders in Jenkins, it also affects Jobs since the directory created for a job is based on the job name as well... So really this issue should be treated both at the folder and job level I suppose...

          (Also note that other build systems such as Continuum are not affected by this problem precisely because they use sequential numbers for creating build directories instead of using the name of the project or the project group).

          Of course, the easy workaround is NOT to use spaces in job or folder names but then it's a bit limitative not to be able to name jobs/folders as you wish and uses spaces or other special characters to enhance legibility..

          Just my humnle opinion...

          Regards
          Laurent
          New: When you create a folder with spaces in the name, and then add a Maven job to it, in some cases the build will fail (e.g. when the Maven project uses plugins to generate sources, such as the jaxws-maven-plugin) because Maven calls a command that is incorrectly parsed by the shell because of spaces in the path.
          What I would suggest is that the underlying directory for a Folder be created using a numerical name rather than the name of the folder entered in the Jenkins UI. This would prevent any issues with spaces or other special characters used in the folder name, plus it would help shorten the directory paths as well. I reckon the easiest way to generate the directory name for the folder would be to calculate the SHA1 or MD5 hash for the folder name and use that as a the 'physical' underlying directory name.
          The Jenkins UI would go on displaying the 'logical' folder name asc usual, but should also indicate the associated 'physical' underlying directory name associated to the folder so that administrators could know where to locate the folder under the jobs/ subdirectory.

          Note that is issue is not specific to Folders in Jenkins, it also affects Jobs since the directory created for a job is based on the job name as well... So really this issue should be treated both at the folder and job level I suppose...

          (Also note that other build systems such as Continuum are not affected by this problem precisely because they use sequential numbers for creating build directories instead of using the name of the project or the project group).

          Of course, the easy workaround is NOT to use spaces in job or folder names but then it's a bit limitative not to be able to name jobs/folders as you wish and uses spaces or other special characters to enhance legibility..

          Just my humnle opinion...

          Regards
          Laurent

          PS - Edited to add affected components: "maven", "core", "cloudbees-folder" -- please feel free to change affected components since I'm nbot sure theses are the tight categories to use
          Laurent Denanot made changes -
          Description Original: When you create a folder with spaces in the name, and then add a Maven job to it, in some cases the build will fail (e.g. when the Maven project uses plugins to generate sources, such as the jaxws-maven-plugin) because Maven calls a command that is incorrectly parsed by the shell because of spaces in the path.
          What I would suggest is that the underlying directory for a Folder be created using a numerical name rather than the name of the folder entered in the Jenkins UI. This would prevent any issues with spaces or other special characters used in the folder name, plus it would help shorten the directory paths as well. I reckon the easiest way to generate the directory name for the folder would be to calculate the SHA1 or MD5 hash for the folder name and use that as a the 'physical' underlying directory name.
          The Jenkins UI would go on displaying the 'logical' folder name asc usual, but should also indicate the associated 'physical' underlying directory name associated to the folder so that administrators could know where to locate the folder under the jobs/ subdirectory.

          Note that is issue is not specific to Folders in Jenkins, it also affects Jobs since the directory created for a job is based on the job name as well... So really this issue should be treated both at the folder and job level I suppose...

          (Also note that other build systems such as Continuum are not affected by this problem precisely because they use sequential numbers for creating build directories instead of using the name of the project or the project group).

          Of course, the easy workaround is NOT to use spaces in job or folder names but then it's a bit limitative not to be able to name jobs/folders as you wish and uses spaces or other special characters to enhance legibility..

          Just my humnle opinion...

          Regards
          Laurent

          PS - Edited to add affected components: "maven", "core", "cloudbees-folder" -- please feel free to change affected components since I'm nbot sure theses are the tight categories to use
          New: When you create a folder with spaces in the name, and then add a Maven job to it, in some cases the build will fail (e.g. when the Maven project uses plugins to generate sources, such as the jaxws-maven-plugin) because Maven calls a command that is incorrectly parsed by the shell because of spaces in the path.
          What I would suggest is that the underlying directory for a Folder be created using a numerical name rather than the name of the folder entered in the Jenkins UI. This would prevent any issues with spaces or other special characters used in the folder name, plus it would help shorten the directory paths as well. I reckon the easiest way to generate the directory name for the folder would be to calculate the SHA1 or MD5 hash for the folder name and use that as a the 'physical' underlying directory name.
          The Jenkins UI would go on displaying the 'logical' folder name asc usual, but should also indicate the associated 'physical' underlying directory name associated to the folder so that administrators could know where to locate the folder under the jobs/ subdirectory.

          Note that is issue is not specific to Folders in Jenkins, it also affects Jobs since the directory created for a job is based on the job name as well... So really this issue should be treated both at the folder and job level I suppose...

          (Also note that other build systems such as Continuum are not affected by this problem precisely because they use sequential numbers for creating build directories instead of using the name of the project or the project group).

          Of course, the easy workaround is NOT to use spaces in job or folder names but then it's a bit limitative not to be able to name jobs/folders as you wish and uses spaces or other special characters to enhance legibility..

          Just my humnle opinion...

          Regards
          Laurent

          PS - Edited to add affected components: "maven", "core", "cloudbees-folder" -- please feel free to change affected components since I'm not sure these are the right categories to use

          Daniel Beck added a comment -

          You already have the following two options:

          • Define a custom workspace in all affected jobs (in freestyle jobs hidden as Advanced Project Option)
          • Define Display Name (in freestyle jobs hidden as Advanced Project Option). There you can go nuts and use all the spaces, or Unicode snowmen, you want. Limit yourself to basic ASCII (I require something like [a-zA-Z0-9._-] in Global Configuration » Restrict project naming) and you'll be fine.

          Given those (you mention neither), is this really a problem?

          Daniel Beck added a comment - You already have the following two options: Define a custom workspace in all affected jobs (in freestyle jobs hidden as Advanced Project Option ) Define Display Name (in freestyle jobs hidden as Advanced Project Option ). There you can go nuts and use all the spaces, or Unicode snowmen, you want. Limit yourself to basic ASCII (I require something like [a-zA-Z0-9._-] in Global Configuration » Restrict project naming ) and you'll be fine. Given those (you mention neither), is this really a problem?
          Jesse Glick made changes -
          Component/s Original: cloudbees-folder [ 18137 ]
          Labels New: folders space

          Jesse Glick added a comment -

          As designed. Any Maven plugins (etc.) which do not work when run inside a project path containing a space are simply broken. (Has no one ever tried running them inside C:\Documents and Settings\Poor Spacey User\My Maven Projects?)

          Jesse Glick added a comment - As designed. Any Maven plugins (etc.) which do not work when run inside a project path containing a space are simply broken. (Has no one ever tried running them inside C:\Documents and Settings\Poor Spacey User\My Maven Projects ?)
          Jesse Glick made changes -
          Resolution New: Not A Defect [ 7 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

          Gregory Fong added a comment -

          I agree there's a straightforward workaround, but it's wrong to say this is "Not A Defect". This is still a bug, albeit a minor one. Could this be reopened, possibly with a much lower priority than before?

          Gregory Fong added a comment - I agree there's a straightforward workaround, but it's wrong to say this is "Not A Defect". This is still a bug, albeit a minor one. Could this be reopened, possibly with a much lower priority than before?

          Jesse Glick added a comment -

          gregoryfong_vg I do not agree this is a bug at all. Jenkins uses the full name of the folder + job in the workspace path. If your projects have bugs in their build systems preventing them from being built in directories which contain certain characters such as spaces, you should not use those characters in folder or job names (and you should consider configuring Restrict project naming to make sure no one forgets); you can feel free to use any wild characters in display names.

          Jesse Glick added a comment - gregoryfong_vg I do not agree this is a bug at all. Jenkins uses the full name of the folder + job in the workspace path. If your projects have bugs in their build systems preventing them from being built in directories which contain certain characters such as spaces, you should not use those characters in folder or job names (and you should consider configuring Restrict project naming to make sure no one forgets); you can feel free to use any wild characters in display names.

          Gregory Fong added a comment -

          jglick Our build system handles spaces just fine. The issue I was finding was when passing in the ``--strip-path $WORKSPACE`` with the coverity plugin. There doesn't seem to be any good way to quote or escape the contents of "$WORKSPACE" such that it will work properly, though thinking about it more I'm not quite sure this is an issue with how jenkins passes things to the coverity plugin or with the coverity plugin itself.

          Gregory Fong added a comment - jglick Our build system handles spaces just fine. The issue I was finding was when passing in the ``--strip-path $WORKSPACE`` with the coverity plugin. There doesn't seem to be any good way to quote or escape the contents of "$WORKSPACE" such that it will work properly, though thinking about it more I'm not quite sure this is an issue with how jenkins passes things to the coverity plugin or with the coverity plugin itself.

            Unassigned Unassigned
            ldenanot Laurent Denanot
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: