Jenkins / Buildr running the eclipse compiler for 'javac' without changing system java

180 Views Asked by At

I'm instrumenting my java builds through jenkins, and the warnings plug-in has an option for scanning classes with the eclipse compiler, but I can't make it produce anything.

I looked through the buildr code and it looks like it uses a literal 'javac' when compiling, so I'm not sure how I could optionally switch out the compiler just for my test build (we have many other environments running java builds that I don't want to interfere with).

The standard javac is generating warnings, but I would like to be able to take an easy second pass with buildr and get those warnings as well.

Any idea how to make this work?

2

There are 2 best solutions below

0
On

Jenkins is just automating your build. The Warnings plug-in just parses your build output, which contains compiler output, and generates the warning reports. The plugin cannot in itself switch compiler, that's the job of your build tool. It can only be made aware of the particular compiler you are using.

So to use the eclipse compiler on your project, you have to first configure your build tool (ant, maven, buildr, or whatever you are using) to use the eclipse compiler. Get this to work on your project outside of jenkins. Then you can tell the Warnings plug in to parse the build output.

0
On

I believe I contributed the Eclipse compiler to buildr.

IIRC (sorry, been long), you can call it with:

compile.using :ecj