How to config a Maven Toolchain


How to config a Maven Toolchain and how to integrate that with your goal settings



Follow these steps to use Maven Toolchain in Jenkins and integrate it with your goals settings:

  1. Install the Config Provider Plugin.

  2. Go to “Manage Jenkins -> Managed files”.

Manage Files Option
3. Click on “Add a new config”.

Add a new config option

  1. Click on “Maven toolchain” and click submit.

Maven Toolchain option
5. Paste there your toolchain file and save.

Edit configuration file

  1. Go to your Maven project job and in the “Build Environment” section, click on “Provided configuration files”, select the toolchain file created and choose a variable name.

Config Toolchain variable

  1. Now you can use in your job the variable created.
    For the example provided you only have to add “ -t $TOOLCHAIN ” in your “goal” of your maven job

Note: You need to have one or several JDK installed on the agent and you have to hardcode their paths in the toolchain (You could have some problem using the path of JDKs installed with the default JDK Installer or with the Custom tools installer)

Have more questions? Submit a request


Please sign in to leave a comment.