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

Configure provided settings.xml at the Maven plugin level, not at the Maven job level

      To use global and user settings.xml provided by the Config File Provider plugin, one must declare both files to be used with every single job. This is a lot of work, hence error prone.

      It would be smarter if one could simply go to "Manage Jenkins > Configure Jenkins > Maven" and declare the provided settings.xml files to be used there.

      Benefit: The jobs do not need to know about any particular settings.xml file. All jobs run with this Maven version will then use that settings.xml files automatically. One could not accidentially forget to configure these files at new jobs.

          [JENKINS-16706] Configure provided settings.xml at the Maven plugin level, not at the Maven job level

          ...so what should be the proper way to specify globally setting.xml without configuring each job manually?

          Giacomo Boccardo added a comment - ...so what should be the proper way to specify globally setting.xml without configuring each job manually?

          Anders Hammar added a comment -

          If you in the Jenkins configuration configure "Default (global) settings provider" as "provided settings.xml", that will be the default configuration for both Maven projects (build step) and freeestyle projects (Maven build step). I've just verified this for settings (not global, but I assume that will work as well) in Jenkins LTS 1.609.2 with config-file-provider-plugin 2.8.1 (and maven-project-plugin 1.6).

          Anders Hammar added a comment - If you in the Jenkins configuration configure "Default (global) settings provider" as "provided settings.xml", that will be the default configuration for both Maven projects (build step) and freeestyle projects (Maven build step). I've just verified this for settings (not global, but I assume that will work as well) in Jenkins LTS 1.609.2 with config-file-provider-plugin 2.8.1 (and maven-project-plugin 1.6).

          Anders Hammar added a comment -

          Just to be clear, this default setting can be overridden on projetc level. But for every new project it is going to be the the default configuration. However, it will not affect any existing project. Maybe that's the confusion here.

          Anders Hammar added a comment - Just to be clear, this default setting can be overridden on projetc level. But for every new project it is going to be the the default configuration. However, it will not affect any existing project. Maybe that's the confusion here.

          Markus KARG added a comment - - edited

          What I actually like to get is not an initial setting for a new job, but a facility where I can go to an existing job and say "use the config given to the Maven plugin", and have a setting at the Maven plugin which will be used then. Neither do I want a solution working only for new jobs, nor do I want to use to files found locally in the .m2 folder. I hope it is more clear now what my problem is. I have hundreds of existing jobs and all shall use one central setting independend of the client they are running on.

          Markus KARG added a comment - - edited What I actually like to get is not an initial setting for a new job, but a facility where I can go to an existing job and say "use the config given to the Maven plugin", and have a setting at the Maven plugin which will be used then. Neither do I want a solution working only for new jobs, nor do I want to use to files found locally in the .m2 folder. I hope it is more clear now what my problem is. I have hundreds of existing jobs and all shall use one central setting independend of the client they are running on.

          I hope this feature will be implemented because I can't configure manually all the existing jobs.

          Giacomo Boccardo added a comment - I hope this feature will be implemented because I can't configure manually all the existing jobs.

          bcalmac added a comment -

          So what does JENKINS-17723 fix if this problem is still there? It doesn't look like this is a duplicate. As far as I can see there's currently no way to globally specify a settings.xml to be used by all jobs.

          bcalmac added a comment - So what does JENKINS-17723 fix if this problem is still there? It doesn't look like this is a duplicate. As far as I can see there's currently no way to globally specify a settings.xml to be used by all jobs.

          bcalmac, I don't think this ticket is exactly a duplicate of the other one because, according to the title, it solves the issue only for new jobs.

          Giacomo Boccardo added a comment - bcalmac , I don't think this ticket is exactly a duplicate of the other one because, according to the title, it solves the issue only for new jobs.

          Mike Duigou added a comment -

          The maven plugin "Maven Configuration" of settings.xml seems to be entirely ignored by projects and by scripts which try to run mvn executable directly. The project level "Use default maven settings" should respect the plugin level setting.

          Mike Duigou added a comment - The maven plugin "Maven Configuration" of settings.xml seems to be entirely ignored by projects and by scripts which try to run mvn executable directly. The project level "Use default maven settings" should respect the plugin level setting.

          Nils Renaud added a comment -

          One year later, Is there any news about this feature (which could be really useful !!) ?

          Nils Renaud added a comment - One year later, Is there any news about this feature (which could be really useful !!) ?

          no, but PRs are welcome...

          Dominik Bartholdi added a comment - no, but PRs are welcome...

            domi Dominik Bartholdi
            mkarg Markus KARG
            Votes:
            9 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated: