Repository: quarkusio/quarkus
Issue: Quarkus Gradle plugin breaks Gradle incremental compilation

## Describe the bug
After upgrading to Quarkus 1.13.x I've noticed that all modules that use Quarkus plugin are fully rebuilt everytime. That increases our build times. The issue seems to be related to these fixes: https://github.com/quarkusio/quarkus/pull/16214 and https://github.com/quarkusio/quarkus/pull/15365. 

From Gradle logs I get:
```
Task ':server:compileJava' is not up-to-date because:
  Input property 'options.annotationProcessorPath' file /Users/anzes/Downloads/code-with-quarkus/library/build/libs/library-1.0.0-SNAPSHOT.jar has changed.
The input changes require a full rebuild for incremental task ':server:compileJava'.
```

I think that putting whole compile classpath to annotation classpath is in general not a good idea with Gradle, but I might be wrong.

### Expected behavior
Projects are built incrementally.

### Actual behavior
Projects are not built incrementally.

## To Reproduce
Check attached reproducer.
[code-with-quarkus-example.zip](https://github.com/quarkusio/quarkus/files/6327901/code-with-quarkus-example.zip)


Steps to reproduce the behavior:
1. run ./gradlew compileJava --info -> everything is rebuilt, since it's first compilation
2. run ./gradlew compileJava --info -> nothing is compiled since nothing changed
3. Change String "hello" to "hello1" in LibraryClass.java
4. run ./gradlew compileJava --info -> :library:compileJava is run, :server:compileJava is up-to-date
5. uncomment `id 'io.quarkus'` in server/build.gradle and run ./gradlew compileJava --info two time so compile task are up-to-date
6. Change String "hello1" in LibraryClass.java to  "hello2"
7. run ./gradlew compileJava --info -> :library:compileJava is run and also :server:compileJava with message `The input changes require a full rebuild `
8. Repeat

### Output of `uname -a` or `ver`
MacOS

### Output of `java -version`
Openjdk 11.0.7 2020-04-14

### Quarkus version or git rev
1.13.2.Final

### Build tool (ie. output of `mvnw --version` or `gradlew --version`)
Gradle 6.8.3

Also I noticed that `quarkusGenerateCode` task is not incremental and it's run every time since it does not declare inputs and outputs. But that is unrelated issue :).



Changed files:
devtools/gradle/src/main/java/io/quarkus/gradle/QuarkusPlugin.java

diff --git a/devtools/gradle/src/main/java/io/quarkus/gradle/QuarkusPlugin.java b/devtools/gradle/src/main/java/io/quarkus/gradle/QuarkusPlugin.java
index c2f3d735004..370a14f9533 100644
--- a/devtools/gradle/src/main/java/io/quarkus/gradle/QuarkusPlugin.java
+++ b/devtools/gradle/src/main/java/io/quarkus/gradle/QuarkusPlugin.java
@@ -157,14 +157,6 @@ public void execute(Task test) {
                     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.
-                    Configuration annotationProcessorConfig = configurations.create(ANNOTATION_PROCESSOR_CONFIGURATION_NAME)
-                            .extendsFrom(
-                                    configurations.getByName(JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME),
-                                    configurations.getByName(JavaPlugin.ANNOTATION_PROCESSOR_CONFIGURATION_NAME));
-                    compileJavaTask.getOptions().setAnnotationProcessorPath(annotationProcessorConfig);
-
                     compileJavaTask.dependsOn(quarkusGenerateCode);
 
                     JavaCompile compileTestJavaTask = (JavaCompile) tasks.getByName(JavaPlugin.COMPILE_TEST_JAVA_TASK_NAME);
@@ -229,6 +221,15 @@ public void execute(Task test) {
                                 new File(generatedTestSourceSet.getJava().getClassesDirectory().get().getAsFile(), provider));
                     }
 
+                    // enable the Panache annotation processor on the classpath, if it's found among the dependencies
+                    configurations.getByName(JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME)
+                            .getResolutionStrategy().eachDependency(d -> {
+                                if ("quarkus-panache-common".equals(d.getTarget().getName())
+                                        && "io.quarkus".equals(d.getTarget().getGroup())) {
+                                    project.getDependencies().add("annotationProcessor", d.getRequested().getGroup() + ":"
+                                            + d.getRequested().getName() + ":" + d.getRequested().getVersion());
+                                }
+                            });
                 });
 
         project.getPlugins().withId("org.jetbrains.kotlin.jvm", plugin -> {