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

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

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      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. 

        Attachments

        1. multibranch-pipeline-1.png
          263 kB
          Daniel Qian
        2. multibranch-pipeline-2.png
          100 kB
          Daniel Qian
        3. pipeline-1.png
          124 kB
          Daniel Qian

          Activity

          Hide
          imod 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"
              }
          
          Show
          imod 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" }
          Hide
          chanjarster 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.
          Show
          chanjarster 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.
          Hide
          cleclerc Cyrille Le Clerc added a comment -

          Thanks Daniel Qian 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.

          Show
          cleclerc Cyrille Le Clerc added a comment - Thanks Daniel Qian 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.
          Hide
          chanjarster Daniel Qian added a comment -

          Cyrille Le Clerc I see, thanks

          Show
          chanjarster Daniel Qian added a comment - Cyrille Le Clerc I see, thanks

            People

            • Assignee:
              cleclerc Cyrille Le Clerc
              Reporter:
              chanjarster Daniel Qian
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: