maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mirko Friedenhagen <>
Subject Options for producing class files with different compilers via Maven
Date Thu, 09 Jan 2014 21:13:41 GMT

in the JaCoCo project (a Java code coverage library which uses a Java
agent approach during runtime) we produce some false positives of
uncovered code because of unreachable (e.g. private constructor of a
util class) or synthetic java code (e.g. enum values()).

As we inspect the class files only, we may not (or better do not want
to) rely on parsing the source code for discovering such conditions.
During some experiments we detected that different compilers (javac vs
eclipse ecj) produce very different byte code in classes for the
above. This might be the case for different versions of Sun/Oracle JDK
or JDKs of other vendors as well. I already took a look at "Using
Non-Javac Compilers" of the maven-compiler-plugin[1]

Now my question:
- What would be the best approach to produce JARs which contain class
files of above mentioned false positives produced by the different
- My first idea was to define a define a multi module project with a
JAR module which will only produce a source jar, which will be
unpacked as "generated-sources" in sibling modules which are then
compiled by the different compilers.

For additional ideas or caveats I would be grateful.

Regards Mirko
-- (

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message