Skip to content

Commit

Permalink
Merge pull request quarkusio#24028 from glefloch/fix/23776-backport
Browse files Browse the repository at this point in the history
Use a copy of compile classpath for panache annotation processor lookup
  • Loading branch information
gsmet authored Mar 1, 2022
2 parents a9fad77 + ec596dc commit 33a8552
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
import io.quarkus.gradle.tasks.QuarkusTestNative;
import io.quarkus.gradle.tasks.QuarkusUpdate;
import io.quarkus.gradle.tooling.GradleApplicationModelBuilder;
import io.quarkus.gradle.tooling.dependency.DependencyUtils;
import io.quarkus.gradle.tooling.dependency.ExtensionDependency;

public class QuarkusPlugin implements Plugin<Project> {
Expand Down Expand Up @@ -299,10 +300,12 @@ private void registerConditionalDependencies(Project project) {
configName).declareConditionalDependencies();
deploymentClasspathBuilder.createBuildClasspath(testExtensions, configName);
});
project.getConfigurations().getByName(JavaPlugin.ANNOTATION_PROCESSOR_CONFIGURATION_NAME).getIncoming()
.beforeResolve(annotationProcessors -> {
Set<ResolvedArtifact> compileClasspathArtifacts = project.getConfigurations()
.getByName(JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME).getResolvedConfiguration()
project.getConfigurations().getByName(JavaPlugin.ANNOTATION_PROCESSOR_CONFIGURATION_NAME)
.withDependencies(annotationProcessors -> {
Set<ResolvedArtifact> compileClasspathArtifacts = DependencyUtils
.duplicateConfiguration(project, project.getConfigurations()
.getByName(JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME))
.getResolvedConfiguration()
.getResolvedArtifacts();

// enable the Panache annotation processor on the classpath, if it's found among the dependencies
Expand Down

0 comments on commit 33a8552

Please sign in to comment.