5

I'm finding it difficult to use Maven toolchains together with Jenkins. I need to specify that tests should be run with a 32-bit JVM, and doing this in by placing a suitable JDK definition in $HOME/.m2/toolchains.xml works when I am running locally on my machine, but how do I get this to work in a Jenkins environment where there are multiple slaves which need different toolchain definitions? I don't want to have to place toolchains.xml files in the $HOME directory on each Jenkins slave. I could place toolchains.xml in the root directory of my project, but then how do I specify which JVM each slave should use?

cb4
  • 6,689
  • 7
  • 45
  • 57
JesperE
  • 63,317
  • 21
  • 138
  • 197

1 Answers1

2

You are SOoL.

It is one of my personal per peeves that Toolchains support is lacking a CLI or property override within Maven.

It makes integration testing of Toolchains support within Maven Plugins a right royal pain.

One of these days I will see if I can get it wired up, though you will most likely have to live with the support being only available in Maven 3.0.5 or later

Stephen Connolly
  • 13,872
  • 6
  • 41
  • 63
  • Shit Out Of Luck? Hadn't seen that acronym before... :) Well, I can deal with it only working with Maven 3.0.5. My current solution involves invoking Maven from Jenkins with `-t toolchains-${NODE_NAME}.xml` and then have one xml file for each node in the build farm. Since we only have a handful machines, that works for now. – JesperE Aug 13 '12 at 08:53
  • SORRY Out Of Luck... tsk tsk tsk oh my bad.... I think I might have added the -t in 3.0.4 already! In which case you are not quite so out of luck! – Stephen Connolly Aug 13 '12 at 11:02
  • Hehe. Yes, the `-t` option is available. But it would be even nicer if Jenkins had support for specifying the toolchain specifically for each slave. Ah, well. Maybe I should focus my energy on fixing so that I don't need to specify the JVM at all. :D – JesperE Aug 13 '12 at 11:44
  • 1
    BTW, is there a way for toolchains to specify VM args? – JesperE Aug 13 '12 at 12:43