How to config a Maven Toolchain and how to integrate that with your goal settings
- CloudBees Jenkins Enterprise - Managed Master (CJE-MM)
- CloudBees Jenkins Team (CJT)
- CloudBees Jenkins Platform - Client Master (CJP-CM)
- Config Provider Plugin 2.15.6
Follow these steps to use Maven Toolchain in Jenkins and integrate it with your goals settings:
Install the Config Provider Plugin.
Go to “Manage Jenkins -> Managed files”.
3. Click on “Add a new config”.
- Click on “Maven toolchain” and click submit.
5. Paste there your toolchain file and save.
- 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.
- 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)