From b755b61aa952c9b8f3467e4043e1718e6a6b9480 Mon Sep 17 00:00:00 2001 From: Ladislav Thon Date: Fri, 15 Mar 2024 15:37:36 +0100 Subject: [PATCH] ArC: use ApplicationArchive.getResolvedDependency() to improve error messages --- .../quarkus/arc/deployment/BeanArchiveProcessor.java | 3 ++- .../quarkus/arc/deployment/SplitPackageProcessor.java | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/BeanArchiveProcessor.java b/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/BeanArchiveProcessor.java index 7eca4e3a9a281..21bb7fa92bb52 100644 --- a/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/BeanArchiveProcessor.java +++ b/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/BeanArchiveProcessor.java @@ -229,7 +229,8 @@ private boolean possiblyBeanArchive(ApplicationArchive archive, LOGGER.warnf("Detected bean archive with bean discovery mode of 'all', " + "this is not portable in CDI Lite and is treated as 'annotated' in Quarkus! " + "Path to beans.xml: %s", - archive.getKey() != null ? archive.getKey().toGacString() + ":" + pathVisit.getPath() + archive.getResolvedDependency() != null + ? archive.getResolvedDependency().toCompactCoords() + ":" + pathVisit.getPath() : pathVisit.getPath()); } } diff --git a/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/SplitPackageProcessor.java b/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/SplitPackageProcessor.java index 0f2db510602a1..f68b4256900b6 100644 --- a/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/SplitPackageProcessor.java +++ b/extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/SplitPackageProcessor.java @@ -21,7 +21,7 @@ import io.quarkus.deployment.annotations.BuildProducer; import io.quarkus.deployment.annotations.BuildStep; import io.quarkus.deployment.builditem.ApplicationArchivesBuildItem; -import io.quarkus.maven.dependency.ArtifactKey; +import io.quarkus.maven.dependency.ResolvedDependency; /** * Split package (same package coming from multiple app archives) is considered a bad practice and @@ -105,9 +105,9 @@ void splitPackageDetection(ApplicationArchivesBuildItem archivesBuildItem, Set splitPackages = new TreeSet<>(); while (iterator.hasNext()) { final ApplicationArchive next = iterator.next(); - final ArtifactKey a = next.getKey(); + ResolvedDependency dep = next.getResolvedDependency(); // can be null for instance in test mode where all application classes go under target/classes - if (a == null) { + if (dep == null) { if (archivesBuildItem.getRootArchive().equals(next)) { // the archive we found is a root archive, e.g. application classes splitPackages.add("application classes"); @@ -122,8 +122,8 @@ void splitPackageDetection(ApplicationArchivesBuildItem archivesBuildItem, } } } else { - // Generates an app archive information in form of groupId:artifactId:classifier:type - splitPackages.add(a.toString()); + // Generates an app archive information in form of groupId:artifactId[:classifier][:type]:version + splitPackages.add(dep.toCompactCoords()); } } splitPackagesWarning.append(splitPackages.stream().collect(Collectors.joining(", ", "[", "]")));