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

No credentials injected into managed settings.xml with Pipeline Maven Plugin

XMLWordPrintable

      I have a settings.xml that is managed by the Config File Provider Plugin and uses the option to inject stored credentials from the Jenkins credentials stores instead of having them directly in the settings.xml.

      I'm using this settings.xml in a withMaven block like this:

      withMaven(maven: 'Maven', mavenSettingsConfig: 'default-settings', mavenLocalRepo: '.repo') {
         sh 'mvn help:effective-settings'
      }

      I would have expected that the effective settings would contain <server> sections for the configured credentials, but they don't. All static content from the managed settings.xml is present though.

      I've marked this as Improvement instead of Bug, since https://wiki.jenkins-ci.org/display/JENKINS/Config+File+Provider+Plugin indicates that this might be expected:

      The file types 'Global Maven settings.xml' and 'Maven settings.xml' have built-in support for the Credentials Plugin. When the plugin serves the settings.xml to the maven execution, the credentials get injected. This functionality is only available in the maven builder (e.g. for freestyle projects) and maven project type.

            domi Dominik Bartholdi
            creckord Carsten Reckord
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: