1111import com .fasterxml .jackson .dataformat .yaml .YAMLFactory ;
1212import io .quarkus .bootstrap .BootstrapConstants ;
1313import io .quarkus .bootstrap .model .AppArtifactCoords ;
14+ import io .quarkus .bootstrap .model .AppArtifactKey ;
1415import io .quarkus .bootstrap .model .AppModel ;
1516import java .io .BufferedReader ;
1617import java .io .BufferedWriter ;
@@ -268,11 +269,12 @@ private void validateExtensionDeps() throws MojoExecutionException {
268269
269270 final AppArtifactCoords deploymentCoords = AppArtifactCoords .fromString (deployment );
270271
271- final String rootDeploymentGact = gact ( deploymentCoords );
272+ final AppArtifactKey rootDeploymentGact = deploymentCoords . getKey ( );
272273 final Node rootDeployment = new Node (null , rootDeploymentGact , 2 );
273- final Node rootRuntime = rootDeployment .newChild (gact (project .getArtifact ()), 1 );
274+ final Artifact artifact = project .getArtifact ();
275+ final Node rootRuntime = rootDeployment .newChild (new AppArtifactKey (artifact .getGroupId (), artifact .getArtifactId (), artifact .getClassifier (), artifact .getType ()), 1 );
274276
275- final Map <String , Node > expectedExtensionDeps = new HashMap <>();
277+ final Map <AppArtifactKey , Node > expectedExtensionDeps = new HashMap <>();
276278 expectedExtensionDeps .put (rootDeploymentGact , rootDeployment );
277279 expectedExtensionDeps .put (rootRuntime .gact , rootRuntime );
278280 // collect transitive extension deps
@@ -315,7 +317,7 @@ public boolean visitEnter(DependencyNode node) {
315317 + BootstrapConstants .PROP_DEPLOYMENT_ARTIFACT + " property in its "
316318 + BootstrapConstants .DESCRIPTOR_PATH );
317319 }
318- currentNode = currentNode .newChild (gact ( AppArtifactCoords .fromString (deploymentStr )),
320+ currentNode = currentNode .newChild (AppArtifactCoords .fromString (deploymentStr ). getKey ( ),
319321 currentNodeId );
320322 expectedExtensionDeps .put (currentNode .gact , currentNode );
321323 extDepsTotal .incrementAndGet ();
@@ -353,7 +355,7 @@ public boolean visitEnter(DependencyNode dep) {
353355 if (artifact == null ) {
354356 return true ;
355357 }
356- final Node node = expectedExtensionDeps .get (gact (artifact ));
358+ final Node node = expectedExtensionDeps .get (new AppArtifactKey (artifact . getGroupId (), artifact . getArtifactId (), artifact . getClassifier (), artifact . getExtension () ));
357359 if (node != null && !node .included ) {
358360 node .included = true ;
359361 extDepsTotal .decrementAndGet ();
@@ -372,12 +374,12 @@ public boolean visitLeave(DependencyNode node) {
372374 log .error ("Quarkus Extension Dependency Verification Error" );
373375 log .error ("Deployment artifact " + deploymentCoords +
374376 " was found to be missing dependencies on Quarkus extension artifacts marked with '-' below:" );
375- final List <String > missing = rootDeployment .collectMissing (log );
377+ final List <AppArtifactKey > missing = rootDeployment .collectMissing (log );
376378 final StringBuilder buf = new StringBuilder ();
377379 buf .append ("Deployment artifact " );
378380 buf .append (deploymentCoords );
379381 buf .append (" is missing the following dependencies from its configuration: " );
380- final Iterator <String > i = missing .iterator ();
382+ final Iterator <AppArtifactKey > i = missing .iterator ();
381383 buf .append (i .next ());
382384 while (i .hasNext ()) {
383385 buf .append (", " ).append (i .next ());
@@ -484,62 +486,32 @@ private ObjectMapper getMapper(boolean yaml) {
484486 }
485487 }
486488
487- static String gact (AppArtifactCoords artifact ) {
488- StringBuilder buf = new StringBuilder ();
489- buf .append (artifact .getGroupId ()).append (':' ).append (artifact .getArtifactId ()).append (':' );
490- final String classifier = artifact .getClassifier ();
491- if (classifier != null && !classifier .isEmpty ()) {
492- buf .append (classifier );
493- }
494- return buf .append (':' ).append (artifact .getType ()).append (':' ).toString ();
495- }
496-
497- static String gact (Artifact artifact ) {
498- StringBuilder buf = new StringBuilder ();
499- buf .append (artifact .getGroupId ()).append (':' ).append (artifact .getArtifactId ()).append (':' );
500- final String classifier = artifact .getClassifier ();
501- if (classifier != null && !classifier .isEmpty ()) {
502- buf .append (classifier );
503- }
504- return buf .append (':' ).append (artifact .getType ()).append (':' ).toString ();
505- }
506-
507- static String gact (org .eclipse .aether .artifact .Artifact artifact ) {
508- StringBuilder buf = new StringBuilder ();
509- buf .append (artifact .getGroupId ()).append (':' ).append (artifact .getArtifactId ()).append (':' );
510- final String classifier = artifact .getClassifier ();
511- if (classifier != null && !classifier .isEmpty ()) {
512- buf .append (classifier );
513- }
514- return buf .append (':' ).append (artifact .getExtension ()).append (':' ).toString ();
515- }
516-
517489 private static class Node {
518490 final Node parent ;
519- final String gact ;
491+ final AppArtifactKey gact ;
520492 final int id ;
521493 boolean included ;
522494 List <Node > children = new ArrayList <>(0 );
523495
524- Node (Node parent , String gact , int id ) {
496+ Node (Node parent , AppArtifactKey gact , int id ) {
525497 this .parent = parent ;
526498 this .gact = gact ;
527499 this .id = id ;
528500 }
529501
530- Node newChild (String gact , int id ) {
502+ Node newChild (AppArtifactKey gact , int id ) {
531503 final Node child = new Node (this , gact , id );
532504 children .add (child );
533505 return child ;
534506 }
535507
536- List <String > collectMissing (Log log ) {
537- final List <String > missing = new ArrayList <>();
508+ List <AppArtifactKey > collectMissing (Log log ) {
509+ final List <AppArtifactKey > missing = new ArrayList <>();
538510 collectMissing (log , 0 , missing );
539511 return missing ;
540512 }
541513
542- private void collectMissing (Log log , int depth , List <String > missing ) {
514+ private void collectMissing (Log log , int depth , List <AppArtifactKey > missing ) {
543515 final StringBuilder buf = new StringBuilder ();
544516 if (included ) {
545517 buf .append ('+' );
0 commit comments