Skip to content

Commit

Permalink
Set gradle annotationProcessorPath to compileClassPath
Browse files Browse the repository at this point in the history
  • Loading branch information
glefloch committed Mar 1, 2021
1 parent 0176caa commit 8887cf7
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,14 @@ public void execute(Task test) {
JavaPlugin.class,
javaPlugin -> {
project.afterEvaluate(this::afterEvaluate);
ConfigurationContainer configurations = project.getConfigurations();
JavaCompile compileJavaTask = (JavaCompile) tasks.getByName(JavaPlugin.COMPILE_JAVA_TASK_NAME);

// By default, gradle looks for annotation processors in the annotationProcessor configuration.
// This configure the compile task to look for annotation processors in the compileClasspath.
compileJavaTask.getOptions().setAnnotationProcessorPath(
configurations.getByName(JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME));

compileJavaTask.dependsOn(quarkusGenerateCode);
quarkusGenerateCode.setSourceRegistrar(compileJavaTask::source);

Expand Down Expand Up @@ -169,8 +176,6 @@ public void execute(Task test) {
.plus(mainSourceSet.getOutput())
.plus(testSourceSet.getOutput()));

ConfigurationContainer configurations = project.getConfigurations();

// create a custom configuration for devmode
configurations.create(DEV_MODE_CONFIGURATION_NAME).extendsFrom(
configurations.getByName(JavaPlugin.COMPILE_ONLY_CONFIGURATION_NAME),
Expand Down

0 comments on commit 8887cf7

Please sign in to comment.