On Fri, Jun 19, 2015 at 9:40 AM Jeff MAURY <[email protected]> wrote:
> Hello, > > I have a project which uses an annotation processor to generated files. I > switched source and target from 1.6 to 1.5 > With 1.6 the files where generated in target/generated-sources. > With 1.5 the files are now generated in target/classes > > Does it sound like an expected behavior ? > Apparently yes: the -s argument is only passed for Java 1.6+: https://github.com/sonatype/plexus-compiler/blob/56eac6a4bceb437e6c4bce6e84a1771285915f37/plexus-compilers/plexus-compiler-javac/src/main/java/org/codehaus/plexus/compiler/javac/JavacCompiler.java#L240-L271 And the version is determined by the compilerVersion, and failing that (in most cases) by the sourceVersion: https://github.com/sonatype/plexus-compiler/blob/56eac6a4bceb437e6c4bce6e84a1771285915f37/plexus-compilers/plexus-compiler-javac/src/main/java/org/codehaus/plexus/compiler/javac/JavacCompiler.java#L391-L398 Setting <compilerVersion>1.6</compilerVersion> should fix it. That said, you'd then be cross-compiling (you probably already are) so you'd have to set the bootclasspath et al. to a Java 5 runtime to make sure your code is actually compatible with a Java 5 runtime [1] (Animal Sniffer is not infallible [2]). [1] http://blog.ltgt.net/most-build-tools-misuse-javac/ [2] http://developer-blog.cloudbees.com/2014/12/beware-siren-target-call.html
