How to switch between Maven 2 and Maven 3 at build execution time?

18 views
Skip to first unread message

M. Richey

unread,
Nov 18, 2016, 3:47:11 PM11/18/16
to jenkins...@googlegroups.com
Hello everybody,

we are on our way on to Maven 3. Therefore we once would like to use
Maven 2 for our build and Maven 3 the next time. Unfortunately there is
no option in the Parameterized Trigger Plugin where to define which
Maven version to use. Trying to set the path to either Maven 2 or Maven
3 in the PATH environment variable by the EnvInject-Plugin does not work
either. It seems that the PATH variable does not get evaluated during
the Maven build step in our freestyle projects.

Does anyone have an idea on how to switch the Maven runtime at build
execution time?

Thanks in advance,

Maik

Victor Martinez

unread,
Nov 18, 2016, 5:23:37 PM11/18/16
to Jenkins Users, mri...@gmx.de
Hi,

 Can you try with EnvInject-Plugin plus Shell step/Batch step in your freestyle projects?

Cheers

M. Richey

unread,
Nov 19, 2016, 8:16:12 AM11/19/16
to jenkins...@googlegroups.com

Hi Victor,

you mean calling mvn directly? Yes, that should work, but this is not the desirable way... Furthermore that means, that we need to change all jobs (> 80) and all Maven build steps in there to shell/batch steps. :(

Is that the only possible solution? Are there some more ideas?

Cheers,

Maik

--
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/4153204e-6461-40ef-ad30-a4d75821d4a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages