Toolchains + Exec Maven Plugin = Swiss Army Knife

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.

Advertisements

About Markus Karg

Java Guru with +30 years of experience in professional software development. I travelled the whole world of IT, starting from Sinclair's great ZX Spectrum 48K, Commodore's 4040, over S/370, PCs since legendary XT, CP/M, VM/ESA, DOS, Windows (remember 3.1?), OS/2 WARP, Linux to Android and iOS... and still coding is my passion, and Java is my favourite drug!
This entry was posted in Allgemein, Java, Open Source, Programming, Projects and tagged , . Bookmark the permalink.