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:
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.