Added support for passing annotation processor paths to the Java compiler#519
Added support for passing annotation processor paths to the Java compiler#519sajeerzeji wants to merge 3 commits into
Conversation
| addStringOption(options, "-target", target); | ||
| addStringOption(options, "--release", release); | ||
| addStringOption(options, "-encoding", encoding); | ||
| addStringOption(options, "-processorpath", annotationProcessorPath); |
There was a problem hiding this comment.
Should we also support the annotationProcessors parameter? When I look at ExecuteMojoUtil COMPILE_PARAMS, I see a very long list of possible parameters. Are there more in that list that should be passed along in the JavaCompilerOptions?
There was a problem hiding this comment.
Added annotation processor path and processors support to JavaCompilerOptions for dev mode hot reload compilation
There was a problem hiding this comment.
What about all the other parameters? I am not sure why we have them listed in COMPILE_PARAMS if we are not actually handling them.
There was a problem hiding this comment.
I checked this concern, the COMPILE_PARAMS is used to filter the maven-compiler-plugin configuration before executing the plugin. JavaCompilerOptions is used for hot reload and is populated by getMavenCompilerOptions() and passed to recompileJava().
Most COMPILE_PARAMS are not apply to JavaCompilerOptions, plugin specific parameters(compilerArgs, compilerArgument, etc) control the plugin not the compiler, common parameters(source, target, encoding) are already extracted, and build lifecycle parameters are not relevant for hot reload I think. Annotation processor parameters were the missing ones here, they need artifact resolution and are critical for hot reload, especially for libraries like Lombok.
…rOptions for dev mode hot reload compilation
Fixes OpenLiberty/ci.maven#2021
Added support for passing annotation processor paths to the Java compiler via the -processorpath option. This enables annotation processors (Eg: Lombok) to run during compilation in dev mode.