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

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

XMLWordPrintable

      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

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

              Created:
              Updated:
              Resolved: