[JIRA] (JENKINS-55325) System scope Maven global settings.xml doesn't provide serverIds when using multibranch pipeline

4 views
Skip to first unread message

chanjarster@gmail.com (JIRA)

unread,
Dec 25, 2018, 3:31:02 AM12/25/18
to jenkinsc...@googlegroups.com
Daniel Qian created an issue
 
Jenkins / Bug JENKINS-55325
System scope Maven global settings.xml doesn't provide serverIds when using multibranch pipeline
Issue Type: Bug Bug
Assignee: Alvaro Lobato
Components: pipeline-maven-plugin
Created: 2018-12-25 08:30
Environment: Jenkins ver. 2.150.1
Priority: Minor Minor
Reporter: Daniel Qian

Problem reproduce steps:

  1. Credentials > System > Add Domain A, just has name specified.
  2. In domain A, add a credential C, username: maven repo username, password: maven repo password.
  3.  Manage Jenkins > Managed files, create a maven global settings.xml M, add Server Credentials using credential C.
  4. Create a Multibranch pipeline, in Pipeline Maven Configuration section, using config M.
  5. Run pipeline.

Build log:

[withMaven] using Maven global settings.xml '876cdf5c-802b-4252-a062-4b9d8602dd06' with NO Maven servers credentials provided by Jenkins

If I create credential C and maven global settings.xml M inside Multibranch pipeline, everything goes fine:

[withMaven] using Maven global settings.xml 'f657ec5c-cc63-4730-a133-7e58c3ea433a' with Maven servers credentials provided by Jenkins (replaceAll: true): [mavenServerId: 'supwisdom-snapshots', jenkinsCredentials: '250947bb-2ce2-4cf5-b62f-bba7e2af7df0', username: 'deployment', type: 'UsernamePasswordCredentialsImpl'], [mavenServerId: 'supwisdom-releases', jenkinsCredentials: '250947bb-2ce2-4cf5-b62f-bba7e2af7df0', username: 'deployment', type: 'UsernamePasswordCredentialsImpl']
 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

cleclerc@cloudbees.com (JIRA)

unread,
Dec 25, 2018, 4:48:02 AM12/25/18
to jenkinsc...@googlegroups.com

cleclerc@cloudbees.com (JIRA)

unread,
Dec 26, 2018, 12:34:02 PM12/26/18
to jenkinsc...@googlegroups.com
Cyrille Le Clerc updated an issue
Problem reproduce steps:
# *Credentials* > *System* > Add Domain A, just has name specified.
# In domain A, add a credential C, username: maven repo username, password: maven repo password.
#  *Manage Jenkins* > *Managed files*, create a maven global settings.xml M, add Server Credentials using credential C.
# Create a Multibranch pipeline, in *Pipeline Maven Configuration* section, using config M.
# Run pipeline.

Build log:

{
{ noformat}
[withMaven] using Maven global settings.xml '876cdf5c-802b-4252-a062-4b9d8602dd06' with NO Maven servers credentials provided by Jenkins

{noformat
} }

If I create credential C and maven global settings.xml M inside Multibranch pipeline, everything goes fine:


{ { noformat}
[withMaven] using Maven global settings.xml 'f657ec5c-cc63-4730-a133-7e58c3ea433a' with Maven servers credentials provided by Jenkins (replaceAll: true): [mavenServerId: 'supwisdom-snapshots', jenkinsCredentials: '250947bb-2ce2-4cf5-b62f-bba7e2af7df0', username: 'deployment', type: 'UsernamePasswordCredentialsImpl'], [mavenServerId: 'supwisdom-releases', jenkinsCredentials: '250947bb-2ce2-4cf5-b62f-bba7e2af7df0', username: 'deployment', type: 'UsernamePasswordCredentialsImpl']

{noformat
} }
 

cleclerc@cloudbees.com (JIRA)

unread,
Dec 26, 2018, 12:35:04 PM12/26/18
to jenkinsc...@googlegroups.com

cleclerc@cloudbees.com (JIRA)

unread,
Dec 26, 2018, 12:37:02 PM12/26/18
to jenkinsc...@googlegroups.com
Cyrille Le Clerc commented on Bug JENKINS-55325
 
Re: System scope Maven global settings.xml doesn't provide serverIds when using multibranch pipeline

Better warning message when a Maven settings "<server>" definition is skipped because the credentials are not found https://github.com/jenkinsci/pipeline-maven-plugin/pull/194 .

Daniel Qian I suspect that the credentials referenced in the Maven settings defined globally are not found. I am improving the warning message, we used to silently omit the skipping of the Maven "<server>" definition when the Jenkins credentials where not found.

cleclerc@cloudbees.com (JIRA)

unread,
Dec 26, 2018, 12:42:02 PM12/26/18
to jenkinsc...@googlegroups.com
Cyrille Le Clerc edited a comment on Bug JENKINS-55325
Better warning message when a Maven settings "{{<server>}}" definition is skipped because the credentials are not found https://github.com/jenkinsci/pipeline-maven-plugin/pull/194 .

[~chanjarster] I suspect that the credentials referenced in the Maven settings defined globally are not found. I am improving the warning message, we used to silently omit the skipping of the Maven "{{<server>}}" definition when the Jenkins credentials where not found.


(i) Please note that we recommend  to use human readable Ids rather than the generated ids
* when defining credentials (e.g. '250947bb-2ce2-4cf5-b62f-bba7e2af7df0')
* when defining config files and (global) Maven settings files (e.g. '876cdf5c-802b-4252-a062-4b9d8602dd06' )

cleclerc@cloudbees.com (JIRA)

unread,
Dec 26, 2018, 12:45:03 PM12/26/18
to jenkinsc...@googlegroups.com
Cyrille Le Clerc started work on Bug JENKINS-55325
 
Change By: Cyrille Le Clerc
Status: Open In Progress

chanjarster@gmail.com (JIRA)

unread,
Dec 26, 2018, 9:57:06 PM12/26/18
to jenkinsc...@googlegroups.com

chanjarster@gmail.com (JIRA)

unread,
Dec 26, 2018, 9:59:06 PM12/26/18
to jenkinsc...@googlegroups.com
Daniel Qian commented on Bug JENKINS-55325
 
Re: System scope Maven global settings.xml doesn't provide serverIds when using multibranch pipeline

Cyrille Le Clerc  That's strange, please take a look at screenshot i uploaded. Credentials are listed when define global maven settings.

 

BTW, everything goes fine on Jenkins ver. 2.138.3

chanjarster@gmail.com (JIRA)

unread,
Dec 26, 2018, 10:45:05 PM12/26/18
to jenkinsc...@googlegroups.com
Daniel Qian edited a comment on Bug JENKINS-55325
[~cleclerc]  That's strange weird , please take a look at screenshot i uploaded. Credentials are listed when define global maven settings.


 

BTW, everything goes fine on Jenkins ver. 2.138.3


 

--- update ---

 

I followed your suggestion not using generated ids for credentials and maven settings. Problem solved.

cleclerc@cloudbees.com (JIRA)

unread,
Dec 27, 2018, 5:45:02 AM12/27/18
to jenkinsc...@googlegroups.com

cleclerc@cloudbees.com (JIRA)

unread,
Dec 27, 2018, 5:46:02 AM12/27/18
to jenkinsc...@googlegroups.com

cleclerc@cloudbees.com (JIRA)

unread,
Dec 27, 2018, 5:47:03 AM12/27/18
to jenkinsc...@googlegroups.com
Cyrille Le Clerc edited a comment on Bug JENKINS-55325
[~chanjarster] I have just cut 3.6.6-beta-1 to help you troubleshoot. Could you please test it?

Warning message will look like

{noformat}
[withMaven]  Global Maven settings - Failure to resolve credentials: [mavenServerId: github, jenkinsCredentials: github-credentials]
{noformat}

https://github.com/jenkinsci/pipeline-maven-plugin/releases/tag/pipeline-maven-3.6.6-beta-1

cleclerc@cloudbees.com (JIRA)

unread,
Dec 27, 2018, 10:20:02 AM12/27/18
to jenkinsc...@googlegroups.com

chanjarster@gmail.com (JIRA)

unread,
Dec 28, 2018, 12:49:02 AM12/28/18
to jenkinsc...@googlegroups.com
Daniel Qian commented on Bug JENKINS-55325
 
Re: System scope Maven global settings.xml doesn't provide serverIds when using multibranch pipeline

Cyrille Le Clerc got this error:

[withMaven] Options: []
[withMaven] Available options: 
[withMaven] using JDK installation JDK8
 > git rev-list --no-walk 53afc20dcedbead4067598f6a390fbe456242274 # timeout=10
 > git rev-parse --verify HEAD # timeout=10
Resetting working tree
 > git reset --hard # timeout=10
 > git clean -fdx # timeout=10
[Pipeline] // withMaven
Error when executing cleanup post condition:
java.lang.IllegalStateException: Exception injecting Maven settings.xml 7924a30a-1d73-49ec-8e45-519e868b76e7 during the build: institute-spring-boot-tracing/develop #30: null
	at org.jenkinsci.plugins.pipeline.maven.WithMavenStepExecution2.settingsFromConfig(WithMavenStepExecution2.java:960)
	at org.jenkinsci.plugins.pipeline.maven.WithMavenStepExecution2.setupSettingFile(WithMavenStepExecution2.java:743)
	at org.jenkinsci.plugins.pipeline.maven.WithMavenStepExecution2.setupMaven(WithMavenStepExecution2.java:334)
	at org.jenkinsci.plugins.pipeline.maven.WithMavenStepExecution2.doStart(WithMavenStepExecution2.java:214)
	at org.jenkinsci.plugins.pipeline.maven.fix.jenkins49337.GeneralNonBlockingStepExecution.lambda$run$0(GeneralNonBlockingStepExecution.java:85)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
	at java.util.TreeMap.getEntry(TreeMap.java:347)
	at java.util.TreeMap.containsKey(TreeMap.java:232)
	at java.util.TreeMap$KeySet.contains(TreeMap.java:1137)
	at org.jenkinsci.plugins.configfiles.maven.security.CredentialsHelper.removeMavenServerDefinitions(CredentialsHelper.java:260)
	at org.jenkinsci.plugins.configfiles.maven.security.CredentialsHelper.fillAuthentication(CredentialsHelper.java:130)
	at org.jenkinsci.plugins.pipeline.maven.WithMavenStepExecution2.settingsFromConfig(WithMavenStepExecution2.java:949)
	... 9 more

[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // timeout
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
java.lang.NullPointerException
	at java.util.TreeMap.getEntry(TreeMap.java:347)
	at java.util.TreeMap.containsKey(TreeMap.java:232)
	at java.util.TreeMap$KeySet.contains(TreeMap.java:1137)
	at org.jenkinsci.plugins.configfiles.maven.security.CredentialsHelper.removeMavenServerDefinitions(CredentialsHelper.java:260)
	at org.jenkinsci.plugins.configfiles.maven.security.CredentialsHelper.fillAuthentication(CredentialsHelper.java:130)
	at org.jenkinsci.plugins.pipeline.maven.WithMavenStepExecution2.settingsFromConfig(WithMavenStepExecution2.java:949)
Caused: java.lang.IllegalStateException: Exception injecting Maven settings.xml 7924a30a-1d73-49ec-8e45-519e868b76e7 during the build: institute-spring-boot-tracing/develop #30: null
	at org.jenkinsci.plugins.pipeline.maven.WithMavenStepExecution2.settingsFromConfig(WithMavenStepExecution2.java:960)
	at org.jenkinsci.plugins.pipeline.maven.WithMavenStepExecution2.setupSettingFile(WithMavenStepExecution2.java:743)
	at org.jenkinsci.plugins.pipeline.maven.WithMavenStepExecution2.setupMaven(WithMavenStepExecution2.java:334)
	at org.jenkinsci.plugins.pipeline.maven.WithMavenStepExecution2.doStart(WithMavenStepExecution2.java:214)
	at org.jenkinsci.plugins.pipeline.maven.fix.jenkins49337.GeneralNonBlockingStepExecution.lambda$run$0(GeneralNonBlockingStepExecution.java:85)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Finished: FAILURE

cleclerc@cloudbees.com (JIRA)

unread,
Dec 28, 2018, 2:42:02 AM12/28/18
to jenkinsc...@googlegroups.com

Daniel Qian could one of the "<server>" of your Maven settings xml "7924a30a-1d73-49ec-8e45-519e868b76e7" miss an "<id>" element?

chanjarster@gmail.com (JIRA)

unread,
Dec 28, 2018, 8:03:03 PM12/28/18
to jenkinsc...@googlegroups.com

chanjarster@gmail.com (JIRA)

unread,
Dec 28, 2018, 8:07:03 PM12/28/18
to jenkinsc...@googlegroups.com
Daniel Qian edited a comment on Bug JENKINS-55325
 
Re: System scope Maven global settings.xml doesn't provide serverIds when using multibranch pipeline
[~cleclerc] I don't know, but I keep the content part untouched. See figure below:

!QQ201812...@2x.png|thumbnail!

BTW, I downgrade plugin to v3.6.5 no error shows
up

chanjarster@gmail.com (JIRA)

unread,
Dec 28, 2018, 8:07:04 PM12/28/18
to jenkinsc...@googlegroups.com

Cyrille Le Clerc I don't know, but I keep the content part untouched. See figure below:

BTW, I downgrade plugin to v3.6.5 no error shows

cleclerc@cloudbees.com (JIRA)

unread,
Dec 29, 2018, 10:22:02 AM12/29/18
to jenkinsc...@googlegroups.com

cleclerc@cloudbees.com (JIRA)

unread,
Dec 29, 2018, 2:17:01 PM12/29/18
to jenkinsc...@googlegroups.com

A regression on 3.6.6-beta-1 with maven settings containing comments in the <servers> element.

cleclerc@cloudbees.com (JIRA)

unread,
Dec 30, 2018, 3:07:02 PM12/30/18
to jenkinsc...@googlegroups.com

cleclerc@cloudbees.com (JIRA)

unread,
Jan 2, 2019, 2:42:01 PM1/2/19
to jenkinsc...@googlegroups.com

fakemailred888@gmail.com (JIRA)

unread,
Sep 27, 2019, 12:45:02 PM9/27/19
to jenkinsc...@googlegroups.com
red der commented on Bug JENKINS-55325
 
Re: System scope Maven global settings.xml doesn't provide serverIds when using multibranch pipeline

this issue is back. Im on version 3.8.1,

hard coding server setting in the settings file works but using a username and password to replace does not 

 

This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

fakemailred888@gmail.com (JIRA)

unread,
Sep 27, 2019, 2:09:02 PM9/27/19
to jenkinsc...@googlegroups.com
red der edited a comment on Bug JENKINS-55325
this issue is back. Im on version [3.8.1,|https://jenkins3.bommie.co/teams-bombora/pluginManager/plugin/pipeline-maven/thirdPartyLicenses]

hard coding server setting in the settings file works but using a username and password to replace does not
  work

 

fakemailred888@gmail.com (JIRA)

unread,
Sep 27, 2019, 4:54:03 PM9/27/19
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages