What is the difference between using maven as a tool versus having a slave that has maven installed?

I am using Jenkins on OCP and it came with a slave image for maven and not setup as a tool. I now need to install gradle and I am wondering if I should add it as a tool or make a slave with it installed.

1 Answer 1


Installing it as a tool allows Jenkins to manage the binary and ensure it's available for your build while also providing supporting pipeline syntax withEnv(). Having an agent with the binary allows you to shell out and run your commands using sh without withEnv(). It also allows you to decide where these binaries come from depending on your agent type (static, vm, container, pod).

Personally, I prefer the latter because I can control the updating of said binaries on the agent in a more automated fashion.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.