Hello,
I've configured Jenkins to auto-install Maven, and am successfully using it in a Maven job. Great. I also want to use that same installation of Maven from a Freestyle job, but the environment doesn't have any information in it about the auto-installed tools. I tried to find a way to query Jenkins about the tools that it has auto-installed, on the assumption that it must be available somehow, but I haven't been able to find a way yet. Does anyone know a way to do it using Groovy, or some other method?
Sincerely,
Shane Turner
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/SN1PR0701MB193611B69716E751E93D40F1E3340%40SN1PR0701MB1936.namprd07.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.
Thanks for the reply, Arnaud.
I should have been more clear though. In my case, I want to have Maven available for a shell script build step. In my situation, Maven is called as part of an overall GNU Make build. If I add an "Invoke to-level Maven targets" build step I see the option for setting the Maven version.
I assume I have to trigger the install of Maven somehow, then set up the environment appropriately in the shell script (JAVA_HOME, M2_HOME, PATH, etc.).
Thanks,
Shane
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/25EEA18E-1EC5-4C45-9DAD-D605E3123B6C%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/SN1PR0701MB19362937021B983B6C70722EE3340%40SN1PR0701MB1936.namprd07.prod.outlook.com.
Thanks, Andrew,
Before I got your response, I finally found the options for the combination of EnvInject + Share Object plugins.
For the job in question, I had to check the option "Prepare an environment for the run", which opened up many more configuration options. In that list I had to check the "Populate Tool Installations" option under "EnvInject Contributions".
It appears that I could also have done this globally via the overall Jenkins configuration by checking the "Tools Locations" under the "Global properties" section, then "Add". In my configuration Maven is the first tool in the list. I'll have to test that next.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAPbPdObz26WuZPnMn18mTYqQd0a93kiTNFJ%3DDpmvotgaaterfA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/SN1PR0701MB19362937021B983B6C70722EE3340%40SN1PR0701MB1936.namprd07.prod.outlook.com.