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

mark maven settings / global settings as default for new jobs

    XMLWordPrintable

Details

    Description

      As I have define a settings / global settings for my infrastructure, I'd like all maven jobs to use it without users to manually configure in advanced section - they probably don't know about this.

      ItemListener.onCreate could be used to enforce a maven setting/global setting that has been set to "apply by default"

      Attachments

        Issue Links

          Activity

            ndeloof Nicolas De Loof created issue -
            jglick Jesse Glick added a comment -

            Rather than hacking around with ItemListener (which may not work reliably when using REST, templates, etc.), better to have an instance-wide default which can be set in /configure and if necessary overridden for special jobs.

            jglick Jesse Glick added a comment - Rather than hacking around with ItemListener (which may not work reliably when using REST, templates, etc.), better to have an instance-wide default which can be set in /configure and if necessary overridden for special jobs.

            This is on my list of things to implement since a while and I was thinking to implement it the way Jesse is talking about. So that means it would go into core/maven and not into a the config-file-provider. This would then also allow to define any implementation of the SettingsProviders as default.
            Also I think it would make sense to define an option where the user/admin can force to reconfigure all existing jobs (or better to remove the current configured SettingsProvider) to fall back to the global default. This would allow an admin of a bigger installation to do an easy migration.
            But maybe the later would also be OK if we just provide a groovy script (maybe in scriptler).

            domi Dominik Bartholdi added a comment - This is on my list of things to implement since a while and I was thinking to implement it the way Jesse is talking about. So that means it would go into core/maven and not into a the config-file-provider. This would then also allow to define any implementation of the SettingsProviders as default. Also I think it would make sense to define an option where the user/admin can force to reconfigure all existing jobs (or better to remove the current configured SettingsProvider) to fall back to the global default. This would allow an admin of a bigger installation to do an easy migration. But maybe the later would also be OK if we just provide a groovy script (maybe in scriptler).
            domi Dominik Bartholdi made changes -
            Field Original Value New Value
            Status Open [ 1 ] In Progress [ 3 ]

            I'm working on this here: https://github.com/imod/jenkins/tree/default-maven-settings
            But I have issue to default a SettingsProvider in the Maven Builder - everything is working fine in the Maven Project, but the Builder ignores whatever I try to define as a default.
            Any help appreciated...

            domi Dominik Bartholdi added a comment - I'm working on this here: https://github.com/imod/jenkins/tree/default-maven-settings But I have issue to default a SettingsProvider in the Maven Builder - everything is working fine in the Maven Project, but the Builder ignores whatever I try to define as a default. Any help appreciated...
            domi Dominik Bartholdi made changes -
            Link This issue depends on JENKINS-17858 [ JENKINS-17858 ]

            I found the issue/solution...

            pull request send: https://github.com/jenkinsci/jenkins/pull/772

            domi Dominik Bartholdi added a comment - I found the issue/solution... pull request send: https://github.com/jenkinsci/jenkins/pull/772

            Code changed in jenkins
            User: imod
            Path:
            test/src/test/java/hudson/maven/MavenProjectTest.java
            test/src/test/java/hudson/tasks/MavenTest.java
            http://jenkins-ci.org/commit/jenkins/ad286c5197128e1a625c1a724350ea93b5c406a7
            Log:
            [FIXED JENKINS-17723] add test cases to verify defaulting global settings providers

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: imod Path: test/src/test/java/hudson/maven/MavenProjectTest.java test/src/test/java/hudson/tasks/MavenTest.java http://jenkins-ci.org/commit/jenkins/ad286c5197128e1a625c1a724350ea93b5c406a7 Log: [FIXED JENKINS-17723] add test cases to verify defaulting global settings providers
            scm_issue_link SCM/JIRA link daemon made changes -
            Resolution Fixed [ 1 ]
            Status In Progress [ 3 ] Resolved [ 5 ]

            Code changed in jenkins
            User: Olivier Lamy
            Path:
            core/src/main/java/hudson/tasks/Maven.java
            core/src/main/java/jenkins/mvn/GlobalMavenConfig.java
            core/src/main/resources/hudson/tasks/Maven/config.jelly
            core/src/main/resources/jenkins/mvn/GlobalMavenConfig/config.groovy
            maven-plugin/src/main/java/hudson/maven/MavenModuleSet.java
            test/src/test/java/hudson/maven/MavenProjectTest.java
            test/src/test/java/hudson/tasks/MavenTest.java
            http://jenkins-ci.org/commit/jenkins/70f457d90eed4af593fd7817f49eb6e1fa366b5b
            Log:
            Merge pull request #772 from imod/default-maven-settings

            FIXES JENKINS-17723 - Default maven settings
            Good change !

            Compare: https://github.com/jenkinsci/jenkins/compare/4e37084360a3...70f457d90eed

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Olivier Lamy Path: core/src/main/java/hudson/tasks/Maven.java core/src/main/java/jenkins/mvn/GlobalMavenConfig.java core/src/main/resources/hudson/tasks/Maven/config.jelly core/src/main/resources/jenkins/mvn/GlobalMavenConfig/config.groovy maven-plugin/src/main/java/hudson/maven/MavenModuleSet.java test/src/test/java/hudson/maven/MavenProjectTest.java test/src/test/java/hudson/tasks/MavenTest.java http://jenkins-ci.org/commit/jenkins/70f457d90eed4af593fd7817f49eb6e1fa366b5b Log: Merge pull request #772 from imod/default-maven-settings FIXES JENKINS-17723 - Default maven settings Good change ! Compare: https://github.com/jenkinsci/jenkins/compare/4e37084360a3...70f457d90eed

            Code changed in jenkins
            User: Olivier Lamy
            Path:
            changelog.html
            http://jenkins-ci.org/commit/jenkins/4627ec9f99d842f22c97023db00f5e3ded98d0b0
            Log:
            Update changelog.html

            changelog entry for JENKINS-17723

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Olivier Lamy Path: changelog.html http://jenkins-ci.org/commit/jenkins/4627ec9f99d842f22c97023db00f5e3ded98d0b0 Log: Update changelog.html changelog entry for JENKINS-17723
            dogfood dogfood added a comment -

            Integrated in jenkins_main_trunk #2511
            [FIXED JENKINS-17723] add test cases to verify defaulting global settings providers (Revision ad286c5197128e1a625c1a724350ea93b5c406a7)

            Result = UNSTABLE
            imod : ad286c5197128e1a625c1a724350ea93b5c406a7
            Files :

            • test/src/test/java/hudson/maven/MavenProjectTest.java
            • test/src/test/java/hudson/tasks/MavenTest.java
            dogfood dogfood added a comment - Integrated in jenkins_main_trunk #2511 [FIXED JENKINS-17723] add test cases to verify defaulting global settings providers (Revision ad286c5197128e1a625c1a724350ea93b5c406a7) Result = UNSTABLE imod : ad286c5197128e1a625c1a724350ea93b5c406a7 Files : test/src/test/java/hudson/maven/MavenProjectTest.java test/src/test/java/hudson/tasks/MavenTest.java

            Code changed in jenkins
            User: Olivier Lamy
            Path:
            src/main/java/hudson/maven/MavenModuleSet.java
            http://jenkins-ci.org/commit/maven-plugin/21fbd55cfdc857b4a33614608b29fba5b21c3bb7
            Log:
            Merge pull request #772 from imod/default-maven-settings

            FIXES JENKINS-17723 - Default maven settings
            Good change !
            Originally-Committed-As: 70f457d90eed4af593fd7817f49eb6e1fa366b5b

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Olivier Lamy Path: src/main/java/hudson/maven/MavenModuleSet.java http://jenkins-ci.org/commit/maven-plugin/21fbd55cfdc857b4a33614608b29fba5b21c3bb7 Log: Merge pull request #772 from imod/default-maven-settings FIXES JENKINS-17723 - Default maven settings Good change ! Originally-Committed-As: 70f457d90eed4af593fd7817f49eb6e1fa366b5b
            ahammar Anders Hammar made changes -
            Link This issue is duplicated by JENKINS-16706 [ JENKINS-16706 ]
            domi Dominik Bartholdi made changes -
            Link This issue is duplicated by JENKINS-16706 [ JENKINS-16706 ]
            domi Dominik Bartholdi made changes -
            Link This issue is related to JENKINS-16706 [ JENKINS-16706 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 148903 ] JNJira + In-Review [ 192933 ]
            markewaite Mark Waite made changes -
            Status Resolved [ 5 ] Closed [ 6 ]

            People

              domi Dominik Bartholdi
              ndeloof Nicolas De Loof
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: