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

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

    XMLWordPrintable

    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

          red888 red der created issue -
          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
          red888 red der made changes -
          Field Original Value New Value
          Description Looks like pretty much this same issue: https://issues.jenkins-ci.org/browse/JENKINS-29805

          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"
          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"
          Summary Credentials don't show up in maven settings.xml (regression) Server Credentials created from Jenkins credentials don't show up in maven settings.xml
          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' ]  
          cleclerc Cyrille Le Clerc made changes -
          Assignee Dominik Bartholdi [ domi ] Cyrille Le Clerc [ cleclerc ]
          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.
          cleclerc Cyrille Le Clerc made changes -
          Resolution Cannot Reproduce [ 5 ]
          Status Open [ 1 ] Closed [ 6 ]

            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: