Skip to content

Commit

Permalink
ArC: use ApplicationArchive.getResolvedDependency() to improve error …
Browse files Browse the repository at this point in the history
…messages
  • Loading branch information
Ladicek committed Mar 15, 2024
1 parent 50edfeb commit b755b61
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -105,9 +105,9 @@ void splitPackageDetection(ApplicationArchivesBuildItem archivesBuildItem,
Set<String> 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");
Expand All @@ -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(", ", "[", "]")));
Expand Down

0 comments on commit b755b61

Please sign in to comment.