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

Server Credentials created from Jenkins credentials don't show up in maven settings.xml

    Details

    • Similar Issues:

      Description

      Also on SO: https://stackoverflow.com/questions/58139761/pipeline-maven-plugin-not-replacing-servers-in-global-settings-xml-from-jenkin

      hard coding "<servers></servers>" in the config file works but configuring "Server Credentials" from jenkins credentials is not working. I tried with and without "Replace all"

        Attachments

          Activity

          Hide
          red888 red der added a comment -

          I linked the wrong ticket to this. This is a different issue than the one described in the ticket I linked initially

          Show
          red888 red der added a comment - I linked the wrong ticket to this. This is a different issue than the one described in the ticket I linked initially
          Hide
          cleclerc Cyrille Le Clerc added a comment - - edited

          Cross posting answer already made on https://groups.google.com/forum/#!topic/jenkinsci-users/7P1Wd2W-OcA

           Hello,

          This is one of the most broadly used feature of the pipeline-maven-plugin, I think it works for most user, there is probably a glitch somewhere.

          Can you please share your testing Jenkinsfile and the details reported by withMaven in the build logs?

          The troubleshooting pipeline script should look like

          withMaven(...) {
             sh "mvn help:effective-settings"
          }
          

          The build logs line that reports the credentials injected in the settings looks like

          [withMaven] using Maven global settings.xml 'global-settings-for-pipeline-maven-plugin' with Maven servers credentials provided by Jenkins (replaceAll: false): [mavenServerId: 'github', jenkinsCredentials: 'github-credentials', username: 'cyrille-leclerc', type: 'UsernamePasswordCredentialsImpl'], [mavenServerId: 'nexus3.example.com', jenkinsCredentials: 'api-team-nexus-deployment-credentials', username: 'api-team', type: 'UsernamePasswordCredentialsImpl']
          

           

          Show
          cleclerc Cyrille Le Clerc added a comment - - edited Cross posting answer already made on  https://groups.google.com/forum/#!topic/jenkinsci-users/7P1Wd2W-OcA  Hello, This is one of the most broadly used feature of the pipeline-maven-plugin, I think it works for most user, there is probably a glitch somewhere. Can you please share your testing Jenkinsfile and the details reported by withMaven in the build logs? The troubleshooting pipeline script should look like withMaven(...) { sh "mvn help:effective-settings" } The build logs line that reports the credentials injected in the settings looks like [withMaven] using Maven global settings.xml 'global-settings- for -pipeline-maven-plugin' with Maven servers credentials provided by Jenkins (replaceAll: false ): [mavenServerId: 'github' , jenkinsCredentials: 'github-credentials' , username: 'cyrille-leclerc' , type: 'UsernamePasswordCredentialsImpl' ], [mavenServerId: 'nexus3.example.com' , jenkinsCredentials: 'api-team-nexus-deployment-credentials' , username: 'api-team' , type: 'UsernamePasswordCredentialsImpl' ]  
          Hide
          red888 red der added a comment -

          this can be closed. I gave up and just used a secret file to store my entire config instead. I realized I dont really need this plugin

          Show
          red888 red der added a comment - this can be closed. I gave up and just used a secret file to store my entire config instead. I realized I dont really need this plugin
          Hide
          cleclerc Cyrille Le Clerc added a comment -

          Ack, i'm closing this ticket with "Can't reproduce" as several users have reported that this feature work for them. There me be an edge case or a glitch in the setup.

          Show
          cleclerc Cyrille Le Clerc added a comment - Ack, i'm closing this ticket with "Can't reproduce" as several users have reported that this feature work for them. There me be an edge case or a glitch in the setup.

            People

            • Assignee:
              cleclerc Cyrille Le Clerc
              Reporter:
              red888 red der
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: