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

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

    Details

    • Similar Issues:

      Description

      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.

        Attachments

          Activity

          Hide
          creckord Carsten Reckord added a comment -

          Closing as invalid. Sorry for the noise, I got it working somehow.

          I dug around in the sources a bit and noticed that this should work. So I recreated the whole config file setup, credentials and domains, and suddenly it works, although I have no clue why now and not before...

          Show
          creckord Carsten Reckord added a comment - Closing as invalid. Sorry for the noise, I got it working somehow. I dug around in the sources a bit and noticed that this should work. So I recreated the whole config file setup, credentials and domains, and suddenly it works, although I have no clue why now and not before...
          Hide
          sergey_oplavin Sergey Oplavin added a comment -

          I got the same issue: Could not inject global credentials into settings.xml.
          The issue has gone after I created dummy domain and some credentials in it.
          Moreover, when I deleted my domain, it continued working fine (credentials from Global Credentials were injected properly).

          It looks like some glitch in the plugin 

          Show
          sergey_oplavin Sergey Oplavin added a comment - I got the same issue: Could not inject global credentials into settings.xml. The issue has gone after I created dummy domain and some credentials in it. Moreover, when I deleted my domain, it continued working fine (credentials from Global Credentials were injected properly). It looks like some glitch in the plugin 

            People

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

              Dates

              • Created:
                Updated:
                Resolved: