How inject your Maven settings.xml at folder level with the Credentials plugin

Issue

  • Want to inject the secret settings.xml at folder level to have it available for the jobs inside the folder

 

Environment

  • CloudBees Jenkins Enterprise

Note: This does not work in CloudBees Jenkins Operations Center. This only works with CloudBees Jenkins Enterprise and Jenkins LTS/OSS releases.

 

Resolution

Following plugins need to be installed in your CloudBees Jenkins Enterprise instance:

 

Then, let’s say you have a folder called maven-folder in your instance.

folder.png

 

As you might already know, you are able to use the credential plugin at folder level. So all you need to inject a secret file.

 

folder-credentials.png

 

Now, at job level you need to create a bind in which you will specify the variable you would like to use.

 

binding.png

 

Finally, the only thing we still need to do is to tell maven to use the secret file.

mvn-setup.png

Now, when you build you can see the secret  file is correctly injected.

console-output.png

Have more questions? Submit a request

4 Comments

  • 0
    Avatar
    Kostas Gaitanos

    The screen shots are not displaying here?

  • 0
    Avatar
    Venkatram Vithala

    The screen shots are not displaying here?

  • 0
    Avatar
    Amit Ron

    The screen shots are not displaying here?

  • 0
    Avatar
    Steven Christou

    The images should be restored again.

Please sign in to leave a comment.