Skip to content

Commit

Permalink
Use a copy of compile classpath for panache annotation processor lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
glefloch committed Feb 22, 2022
1 parent 4a0e059 commit 3ec017e
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<ResolvedArtifact> compileClasspathArtifacts = configContainer
.getByName(JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME).getResolvedConfiguration()
configContainer.getByName(JavaPlugin.ANNOTATION_PROCESSOR_CONFIGURATION_NAME)
.defaultDependencies(annotationProcessors -> {
Set<ResolvedArtifact> compileClasspathArtifacts = DependencyUtils
.duplicateConfiguration(project, configContainer
.getByName(JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME))
.getResolvedConfiguration()
.getResolvedArtifacts();
for (ResolvedArtifact artifact : compileClasspathArtifacts) {
if ("quarkus-panache-common".equals(artifact.getName())
Expand Down

0 comments on commit 3ec017e

Please sign in to comment.