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

Pipeline doesnt' provide override global maven configuration option but Multibranch pipeline does

      In a multibranch pipeline job, I can provide config files in that job and override global maven configuration.

      But in a pipeline job, I can't do those things. 

          [JENKINS-54872] Pipeline doesnt' provide override global maven configuration option but Multibranch pipeline does

          the feature you request is not provided by the config-file-provider, but by the 'pipeline maven' plugin: https://plugins.jenkins.io/pipeline-maven
          beside this, I don't think this does make a lot of sense: If you expect this to be configured on each of the pipeline jobs, then you can also just do it inside the Jenkinsfile:

              withMaven(mavenSettingsConfig: 'DEFAULT_MAVEN_SETTINGS', options: [artifactsPublisher(disabled: true)]) {
                  sh "mvn install"
              }
          

          Dominik Bartholdi added a comment - the feature you request is not provided by the config-file-provider, but by the 'pipeline maven' plugin: https://plugins.jenkins.io/pipeline-maven beside this, I don't think this does make a lot of sense: If you expect this to be configured on each of the pipeline jobs, then you can also just do it inside the Jenkinsfile: withMaven(mavenSettingsConfig: 'DEFAULT_MAVEN_SETTINGS' , options: [artifactsPublisher(disabled: true )]) { sh "mvn install" }

          Daniel Qian added a comment -

          Yes, I can use withMaven(mavenSettingsConfig:'...', globalMavenSettingsConfig: '...' but there are two problems:

          1. mavenSettingsConfig and globalMavenSettingsConfig use Config File ids, which is hard to maintain
          2. The most important thing is that makes the Jenkinsfile binds to a specific Jenkins configuration, which cannot be run everywhere.

          Daniel Qian added a comment - Yes, I can use withMaven(mavenSettingsConfig:'...', globalMavenSettingsConfig: '...' but there are two problems: mavenSettingsConfig and globalMavenSettingsConfig use Config File ids, which is hard to maintain The most important thing is that makes the Jenkinsfile binds to a specific Jenkins configuration, which cannot be run everywhere.

          Thanks chanjarster for using the Pipeline Maven Integration. Your desire to rely on maven settings defined outside of the pipeline itself is definitively our best practice.
          So far, We have just considered to redefine default Maven (global) settings at the folder level (precisely at the AbstractFolder level) (here.

          If the config files can be redefined at the Pipeline (ie Item) level, then it would make sense to be able to define the Maven default settings at this level as well.

          A technical challenge I see supporting redefinition of default (global) Maven settings at the Pipeline level is that we would probably have to write a dedicated config screen. At the moment, our configuration block is a fragment intended to be included in the folder configuration file.

          Cyrille Le Clerc added a comment - Thanks chanjarster for using the Pipeline Maven Integration. Your desire to rely on maven settings defined outside of the pipeline itself is definitively our best practice. So far, We have just considered to redefine default Maven (global) settings at the folder level (precisely at the AbstractFolder level) ( here . If the config files can be redefined at the Pipeline (ie Item) level, then it would make sense to be able to define the Maven default settings at this level as well. A technical challenge I see supporting redefinition of default (global) Maven settings at the Pipeline level is that we would probably have to write a dedicated config screen. At the moment, our configuration block is a fragment intended to be included in the folder configuration file.

          Daniel Qian added a comment -

          cleclerc I see, thanks

          Daniel Qian added a comment - cleclerc I see, thanks

            Unassigned Unassigned
            chanjarster Daniel Qian
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: