@@ -242,7 +242,7 @@ private static void fileDependenciesExtractor(ApplicationModelBuilder modelBuild
242
242
.setDirect (true )
243
243
.setRuntimeCp ()
244
244
.setDeploymentCp ();
245
- Utils . processQuarkusDependency (artifactBuilder , modelBuilder );
245
+ processQuarkusDependency (artifactBuilder , modelBuilder );
246
246
modelBuilder .addDependency (artifactBuilder );
247
247
}
248
248
}
@@ -308,22 +308,21 @@ private static void collectDependencies(
308
308
parentModule .addDependency (new ArtifactDependency (depCoords ));
309
309
}
310
310
311
- if (Utils . processQuarkusDependency (depBuilder , modelBuilder )) {
311
+ if (processQuarkusDependency (depBuilder , modelBuilder )) {
312
312
if (isFlagOn (flags , COLLECT_TOP_EXTENSION_RUNTIME_NODES )) {
313
313
depBuilder .setFlags (DependencyFlags .TOP_LEVEL_RUNTIME_EXTENSION_ARTIFACT );
314
314
newFlags = clearFlag (newFlags , COLLECT_TOP_EXTENSION_RUNTIME_NODES );
315
315
}
316
- newFlags = clearFlag (newFlags , COLLECT_RELOADABLE_MODULES );
317
316
}
318
317
if (isFlagOn (flags , COLLECT_RELOADABLE_MODULES )) {
319
- // Checking whether current dependency is a project module is a temporary workaround,
320
- // that is required while projectModule for project dependencies is null (current
321
- // deficiency of this task).
322
- // That's why we set the workspace module flag explicitly via setWorkspaceModule().
323
- // Once we have projectModule set for project dependencies, we can remove this workaround .
324
- final boolean isProjectDependency = resolvedDependency . getSelected ()
325
- . getId () instanceof ProjectComponentIdentifier ;
326
- if ( projectModule != null || isProjectDependency ) {
318
+ if (! depBuilder . isRuntimeExtensionArtifact ()
319
+ && ( projectModule != null
320
+ // Checking whether current dependency is a project module is a temporary workaround,
321
+ // that is required while projectModule for project dependencies is null (current
322
+ // deficiency of this task) .
323
+ // That's why we set the workspace module flag explicitly via setWorkspaceModule().
324
+ // Once we have projectModule set for project dependencies, we can remove this workaround.
325
+ || resolvedDependency . getSelected (). getId () instanceof ProjectComponentIdentifier ) ) {
327
326
depBuilder .setReloadable ().setWorkspaceModule ();
328
327
modelBuilder .addReloadableWorkspaceModule (artifactKey );
329
328
} else {
@@ -552,66 +551,63 @@ public File getFile() {
552
551
}
553
552
}
554
553
555
- public static class Utils {
556
-
557
- public static boolean processQuarkusDependency (ResolvedDependencyBuilder artifactBuilder ,
558
- ApplicationModelBuilder modelBuilder ) {
559
- for (Path artifactPath : artifactBuilder .getResolvedPaths ()) {
560
- if (!Files .exists (artifactPath ) || !artifactBuilder .getType ().equals (ArtifactCoords .TYPE_JAR )) {
561
- break ;
562
- }
563
- if (Files .isDirectory (artifactPath )) {
564
- return processQuarkusDir (artifactBuilder , artifactPath .resolve (BootstrapConstants .META_INF ), modelBuilder );
565
- } else {
566
- try (FileSystem artifactFs = ZipUtils .newFileSystem (artifactPath )) {
567
- return processQuarkusDir (artifactBuilder , artifactFs .getPath (BootstrapConstants .META_INF ),
568
- modelBuilder );
569
- } catch (IOException e ) {
570
- throw new RuntimeException ("Failed to process " + artifactPath , e );
571
- }
554
+ private static boolean processQuarkusDependency (ResolvedDependencyBuilder artifactBuilder ,
555
+ ApplicationModelBuilder modelBuilder ) {
556
+ for (Path artifactPath : artifactBuilder .getResolvedPaths ()) {
557
+ if (!Files .exists (artifactPath ) || !artifactBuilder .getType ().equals (ArtifactCoords .TYPE_JAR )) {
558
+ break ;
559
+ }
560
+ if (Files .isDirectory (artifactPath )) {
561
+ return processQuarkusDir (artifactBuilder , artifactPath .resolve (BootstrapConstants .META_INF ), modelBuilder );
562
+ } else {
563
+ try (FileSystem artifactFs = ZipUtils .newFileSystem (artifactPath )) {
564
+ return processQuarkusDir (artifactBuilder , artifactFs .getPath (BootstrapConstants .META_INF ),
565
+ modelBuilder );
566
+ } catch (IOException e ) {
567
+ throw new RuntimeException ("Failed to process " + artifactPath , e );
572
568
}
573
569
}
574
- return false ;
575
570
}
571
+ return false ;
572
+ }
576
573
577
- private static boolean processQuarkusDir (ResolvedDependencyBuilder artifactBuilder , Path quarkusDir ,
578
- ApplicationModelBuilder modelBuilder ) {
579
- if (!Files .exists (quarkusDir )) {
580
- return false ;
581
- }
582
- final Path quarkusDescr = quarkusDir .resolve (BootstrapConstants .DESCRIPTOR_FILE_NAME );
583
- if (!Files .exists (quarkusDescr )) {
584
- return false ;
585
- }
586
- final Properties extProps = readDescriptor (quarkusDescr );
587
- if (extProps == null ) {
588
- return false ;
589
- }
590
- artifactBuilder .setRuntimeExtensionArtifact ();
591
- modelBuilder .handleExtensionProperties (extProps , artifactBuilder .getKey ());
592
-
593
- final String providesCapabilities = extProps .getProperty (BootstrapConstants .PROP_PROVIDES_CAPABILITIES );
594
- if (providesCapabilities != null ) {
595
- modelBuilder
596
- .addExtensionCapabilities (
597
- CapabilityContract .of (artifactBuilder .toGACTVString (), providesCapabilities , null ));
598
- }
599
- return true ;
574
+ private static boolean processQuarkusDir (ResolvedDependencyBuilder artifactBuilder , Path quarkusDir ,
575
+ ApplicationModelBuilder modelBuilder ) {
576
+ if (!Files .exists (quarkusDir )) {
577
+ return false ;
578
+ }
579
+ final Path quarkusDescr = quarkusDir .resolve (BootstrapConstants .DESCRIPTOR_FILE_NAME );
580
+ if (!Files .exists (quarkusDescr )) {
581
+ return false ;
582
+ }
583
+ final Properties extProps = readDescriptor (quarkusDescr );
584
+ if (extProps == null ) {
585
+ return false ;
600
586
}
587
+ artifactBuilder .setRuntimeExtensionArtifact ();
588
+ modelBuilder .handleExtensionProperties (extProps , artifactBuilder .getKey ());
589
+
590
+ final String providesCapabilities = extProps .getProperty (BootstrapConstants .PROP_PROVIDES_CAPABILITIES );
591
+ if (providesCapabilities != null ) {
592
+ modelBuilder
593
+ .addExtensionCapabilities (
594
+ CapabilityContract .of (artifactBuilder .toGACTVString (), providesCapabilities , null ));
595
+ }
596
+ return true ;
597
+ }
601
598
602
- private static Properties readDescriptor (final Path path ) {
603
- final Properties rtProps ;
604
- if (!Files .exists (path )) {
605
- // not a platform artifact
606
- return null ;
607
- }
608
- rtProps = new Properties ();
609
- try (BufferedReader reader = Files .newBufferedReader (path )) {
610
- rtProps .load (reader );
611
- } catch (IOException e ) {
612
- throw new UncheckedIOException ("Failed to load extension description " + path , e );
613
- }
614
- return rtProps ;
599
+ private static Properties readDescriptor (final Path path ) {
600
+ final Properties rtProps ;
601
+ if (!Files .exists (path )) {
602
+ // not a platform artifact
603
+ return null ;
604
+ }
605
+ rtProps = new Properties ();
606
+ try (BufferedReader reader = Files .newBufferedReader (path )) {
607
+ rtProps .load (reader );
608
+ } catch (IOException e ) {
609
+ throw new UncheckedIOException ("Failed to load extension description " + path , e );
615
610
}
611
+ return rtProps ;
616
612
}
617
613
}
0 commit comments