I am pretty excited about Karl Heinz Marbaise this week kindly releasing version 1.5.0 of Exec Maven Plugin, because it contains three additions which are really awesome (not only because I authored them, but because of their combined effect): Support for custom tool chains, an integrated and fully configurable toolchain, and finally a documentation how to use both together.
What makes this combination so great is that you now have a Swiss Army Knife which makes integration of native tools much easier. In my case, I had to provide POMs for projects written in ancient languages like Install Script (Install Shield), Power Script (Power Builder), MS Visual C++ 6, Borland C++ Builder 7, and other deprecated technology. It was hard to tell our Jenkins build nodes where all those tools are located on disk without cluttering the OS search PATH. Certainly the clean solution would have been writing a Maven plugin for each of those tools, and let that plugin find it on disk somehow magically (i. e. running a Windows registry query or checking product-specific environment variables). But the exec plugin was much cheaper to employ. The only pain point was that I had to put all the tools statically in the OS search PATH.
My contribution allows to get rid of that PATH: Just define the path to each tool using the new and now embedded Paths Maven Toolchain by locating a toolchains.xml file in the .m2 configuration file and we’re done. This keeps the PATH pristine, and is a 100% clean Maven solution. Not as sophisticated as custom plugins certainly, but getting the project days earlier finished!
Now, if you don’t know how to use this new cool stuff, just copy-and-paste the example I added to the docs: http://www.mojohaus.org/exec-maven-plugin/examples/example-exec-using-toolchains.html.