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

Use system default Maven, Maven Settings if not specified

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Currently, when you use the ``withMaven`` step, you need to specify the Maven installation. Furthermore, if you've configured, using the Managed Files and Global Tools Configuration, a maven settings.xml, you need to specify an ugly ID for that.

      For example:
      withMaven(maven: 'Maven 3.3', mavenSettingsConfig: 'ecbd05c9-e03e-4ccb-9aa1-242f9f1a423c')

      { sh "mvn clean verify -B" }

      It would be good if these could both be defaulted - at least, the mavenSettingsConfig, which doesn't have to be specified with the freestyle Maven Builder.

        Attachments

          Issue Links

            Activity

            Show
            cleclerc Cyrille Le Clerc added a comment - - edited Work in progress  https://github.com/jenkinsci/pipeline-maven-plugin/pull/31 https://github.com/jenkinsci/jenkins/pull/2818  
            Show
            cleclerc Cyrille Le Clerc added a comment - See https://github.com/jenkinsci/pipeline-maven-plugin/pull/44
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Cyrille Le Clerc
            Path:
            jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/WithMavenStepExecution.java
            jenkins-plugin/src/test/java/org/jenkinsci/plugins/pipeline/maven/WithMavenStepOnMasterTest.java
            http://jenkins-ci.org/commit/pipeline-maven-plugin/a0d182bb1257e5d96f7d4a15434493b5cb3bec82
            Log:
            Merge pull request #44 from jenkinsci/JENKINS-40665-3

            JENKINS-39407 Use Maven Settings and Maven Global Settings defined in the Jenkins Global Configuration

            Compare: https://github.com/jenkinsci/pipeline-maven-plugin/compare/2eabb4b13a8e...a0d182bb1257

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Cyrille Le Clerc Path: jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/WithMavenStepExecution.java jenkins-plugin/src/test/java/org/jenkinsci/plugins/pipeline/maven/WithMavenStepOnMasterTest.java http://jenkins-ci.org/commit/pipeline-maven-plugin/a0d182bb1257e5d96f7d4a15434493b5cb3bec82 Log: Merge pull request #44 from jenkinsci/ JENKINS-40665 -3 JENKINS-39407 Use Maven Settings and Maven Global Settings defined in the Jenkins Global Configuration Compare: https://github.com/jenkinsci/pipeline-maven-plugin/compare/2eabb4b13a8e...a0d182bb1257
            Hide
            cleclerc Cyrille Le Clerc added a comment - - edited

            Robert Watkins could you test https://github.com/jenkinsci/pipeline-maven-plugin/releases/tag/pipeline-maven-parent-2.1.0-beta-1 ? It's a beta version, it does not appear in the update center unless you have enable the "experimental" update center.

            You can verify that the settings are used with "mvn help:effective-settings".

            The log message indicating that Maven settings and/or Maven Global Settings are injected look like

            [withMaven] use Maven global settings provided by the Jenkins global configuration 'global-maven-settings' 
            [withMaven] use Maven global settings.xml 'global-maven-settings' with Maven servers credentials provided by Jenkins (replaceAll: false): [mavenServerId: 'global-credentials-bitbucket', jenkinsCredentials: 'bitbucket-credentials', username: 'cleclerc', type: 'UsernamePasswordCredentialsImpl']
            
            Show
            cleclerc Cyrille Le Clerc added a comment - - edited Robert Watkins could you test https://github.com/jenkinsci/pipeline-maven-plugin/releases/tag/pipeline-maven-parent-2.1.0-beta-1 ? It's a beta version, it does not appear in the update center unless you have enable the "experimental" update center. You can verify that the settings are used with " mvn help:effective-settings ". The log message indicating that Maven settings and/or Maven Global Settings are injected look like [withMaven] use Maven global settings provided by the Jenkins global configuration 'global-maven-settings' [withMaven] use Maven global settings.xml 'global-maven-settings' with Maven servers credentials provided by Jenkins (replaceAll: false): [mavenServerId: 'global-credentials-bitbucket', jenkinsCredentials: 'bitbucket-credentials', username: 'cleclerc', type: 'UsernamePasswordCredentialsImpl']
            Hide
            cleclerc Cyrille Le Clerc added a comment -

            System default (ie Jenkins "Global Tools Configuration") Maven settings and Maven Global Settings are supported in version 2.1.0.
            As there is no support for defining the default Maven version in the "Global Tools Configuration", I close this RFE.
            We could create another RFE to introduce the support of a default Maven version (ie Jenkins "Global Tools Configuration" or equivalent at the folder level).

            Show
            cleclerc Cyrille Le Clerc added a comment - System default (ie Jenkins "Global Tools Configuration") Maven settings and Maven Global Settings are supported in version 2.1.0. As there is no support for defining the default Maven version in the "Global Tools Configuration", I close this RFE. We could create another RFE to introduce the support of a default Maven version (ie Jenkins "Global Tools Configuration" or equivalent at the folder level).

              People

              • Assignee:
                cleclerc Cyrille Le Clerc
                Reporter:
                twasink Robert Watkins
              • Votes:
                2 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: