From 3ec017e58c7993020e887924943839ee9c27e712 Mon Sep 17 00:00:00 2001 From: Guillaume Le Floch Date: Tue, 22 Feb 2022 16:54:28 +0100 Subject: [PATCH] Use a copy of compile classpath for panache annotation processor lookup --- .../ApplicationDeploymentClasspathBuilder.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/devtools/gradle/gradle-model/src/main/java/io/quarkus/gradle/dependency/ApplicationDeploymentClasspathBuilder.java b/devtools/gradle/gradle-model/src/main/java/io/quarkus/gradle/dependency/ApplicationDeploymentClasspathBuilder.java index 049f5f9355d31..6071affbcdd4d 100644 --- a/devtools/gradle/gradle-model/src/main/java/io/quarkus/gradle/dependency/ApplicationDeploymentClasspathBuilder.java +++ b/devtools/gradle/gradle-model/src/main/java/io/quarkus/gradle/dependency/ApplicationDeploymentClasspathBuilder.java @@ -70,10 +70,12 @@ public static void initConfigurations(Project project) { configContainer.getByName(JavaPlugin.RUNTIME_CLASSPATH_CONFIGURATION_NAME)); // enable the Panache annotation processor on the classpath, if it's found among the dependencies - configContainer.getByName(JavaPlugin.ANNOTATION_PROCESSOR_CONFIGURATION_NAME).getIncoming() - .beforeResolve(annotationProcessors -> { - Set compileClasspathArtifacts = configContainer - .getByName(JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME).getResolvedConfiguration() + configContainer.getByName(JavaPlugin.ANNOTATION_PROCESSOR_CONFIGURATION_NAME) + .defaultDependencies(annotationProcessors -> { + Set compileClasspathArtifacts = DependencyUtils + .duplicateConfiguration(project, configContainer + .getByName(JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME)) + .getResolvedConfiguration() .getResolvedArtifacts(); for (ResolvedArtifact artifact : compileClasspathArtifacts) { if ("quarkus-panache-common".equals(artifact.getName())