plexus-compiler icon indicating copy to clipboard operation
plexus-compiler copied to clipboard

JavacCompiler uses the wrong heuristic for configuring annotation processing

Open gilday opened this issue 7 years ago • 0 comments

The JavacCompiler class will not configure annotation processing if the source version is < 1.6, regardless of the JDK version in use. The impact to JDK 1.6+ systems which are configured to source version 1.5 is that JavacCompiler will ignore the generated sources configurations and javac will process annotations using its default conventions.

In my environment, I am using Maven with JDK 1.8 and targeting Java 1.5 source. I would expect sources generated by annotation processors to be generated in the maven-compiler-plugin default generated sources directory (${project.build.directory}/generated-sources/annotations), but plexus-compiler never passes the -s flag to javac so the sources are instead generated in ${project.build.outputDirectory}.

gilday avatar Dec 04 '18 15:12 gilday