@@ -249,9 +249,9 @@ private void registerTasks(Project project, QuarkusPluginExtension quarkusExt) {
249249 QuarkusBuildDependencies .class ,
250250 task -> {
251251 configureQuarkusBuildTask (project , task , quarkusBuildAppModelTask , serviceProvider );
252-
253252 task .getOutputs ().doNotCacheIf ("Dependencies are never cached" , t -> true );
254253 });
254+ project .afterEvaluate (evaluated -> addDependencyOnJandexIfConfigured (evaluated , quarkusBuildDependencies ));
255255
256256 Property <Boolean > cacheLargeArtifacts = quarkusExt .getCacheLargeArtifacts ();
257257
@@ -646,7 +646,7 @@ private void visitProjectDep(Project project, Project dep, Set<String> visited)
646646 }
647647
648648 private void setupQuarkusBuildTaskDeps (Project project , Project dep , Set <String > visited ) {
649- if (!visited .add (dep .getGroup () + ":" + dep . getName ())) {
649+ if (!visited .add (dep .getPath ())) {
650650 return ;
651651 }
652652
@@ -663,18 +663,24 @@ private void setupQuarkusBuildTaskDeps(Project project, Project dep, Set<String>
663663 });
664664
665665 getLazyTask (project , QUARKUS_DEV_TASK_NAME ).ifPresent (quarkusDev -> {
666- for (String taskName : new String [] { JavaPlugin .PROCESS_RESOURCES_TASK_NAME ,
667- // This is the task of the 'org.kordamp.gradle.jandex' Gradle plugin
668- "jandex" ,
669- // This is the task of the 'com.github.vlsi.jandex' Gradle plugin
670- "processJandexIndex" }) {
671- getLazyTask (dep , taskName ).ifPresent (t -> quarkusDev .configure (qd -> qd .dependsOn (t )));
672- }
666+ getLazyTask (project , JavaPlugin .PROCESS_RESOURCES_TASK_NAME )
667+ .ifPresent (t -> quarkusDev .configure (qd -> qd .dependsOn (t )));
668+ addDependencyOnJandexIfConfigured (dep , quarkusDev );
673669 });
674670
675671 visitProjectDependencies (project , dep , visited );
676672 }
677673
674+ private void addDependencyOnJandexIfConfigured (Project project , TaskProvider <? extends Task > quarkusTask ) {
675+ for (String taskName : new String [] {
676+ // This is the task of the 'org.kordamp.gradle.jandex' Gradle plugin
677+ "jandex" ,
678+ // This is the task of the 'com.github.vlsi.jandex' Gradle plugin
679+ "processJandexIndex" }) {
680+ getLazyTask (project , taskName ).ifPresent (t -> quarkusTask .configure (qd -> qd .mustRunAfter (t )));
681+ }
682+ }
683+
678684 protected void visitProjectDependencies (Project project , Project dep , Set <String > visited ) {
679685 final Configuration compileConfig = dep .getConfigurations ().findByName (JavaPlugin .COMPILE_CLASSPATH_CONFIGURATION_NAME );
680686 if (compileConfig != null ) {
@@ -689,10 +695,10 @@ protected void visitProjectDependencies(Project project, Project dep, Set<String
689695 .forEach (d -> {
690696 Project depProject = null ;
691697
692- if (d instanceof ProjectDependency ) {
693- depProject = dep .project ((( ProjectDependency ) d ) .getPath ());
694- } else if (d instanceof ExternalModuleDependency ) {
695- depProject = ToolingUtils .findIncludedProject (project , ( ExternalModuleDependency ) d );
698+ if (d instanceof ProjectDependency projectDep ) {
699+ depProject = dep .project (projectDep .getPath ());
700+ } else if (d instanceof ExternalModuleDependency externalModuleDep ) {
701+ depProject = ToolingUtils .findIncludedProject (project , externalModuleDep );
696702 }
697703
698704 if (depProject == null ) {
@@ -711,13 +717,9 @@ protected void visitProjectDependencies(Project project, Project dep, Set<String
711717 private void visitLocalProject (Project project , Project localProject , Set <String > visited ) {
712718 // local dependency, so we collect also its dependencies
713719 visitProjectDep (project , localProject , visited );
714-
715- ExtensionDependency <?> extensionDependency = DependencyUtils
716- .getExtensionInfoOrNull (project , localProject );
717-
718- if (extensionDependency instanceof ProjectExtensionDependency ) {
719- visitProjectDep (project ,
720- ((ProjectExtensionDependency ) extensionDependency ).getDeploymentModule (), visited );
720+ ExtensionDependency <?> extensionDependency = DependencyUtils .getExtensionInfoOrNull (project , localProject );
721+ if (extensionDependency instanceof ProjectExtensionDependency projectExtDep ) {
722+ visitProjectDep (project , projectExtDep .getDeploymentModule (), visited );
721723 }
722724 }
723725
0 commit comments