diff --git a/platform-bom/src/main/java/io/quarkus/bom/platform/DependencyManagementConfig.java b/platform-bom/src/main/java/io/quarkus/bom/platform/DependencyManagementConfig.java index 8fdea81c..0e23e162 100644 --- a/platform-bom/src/main/java/io/quarkus/bom/platform/DependencyManagementConfig.java +++ b/platform-bom/src/main/java/io/quarkus/bom/platform/DependencyManagementConfig.java @@ -63,8 +63,12 @@ public List toAetherDependencies() { final ArtifactKey key = ArtifactKey.fromString(e); exclusions.add(new Exclusion(key.getGroupId(), key.getArtifactId(), key.getClassifier(), key.getType())); } + String scope = dep.getScope(); + if (scope == null || scope.isEmpty()) { + scope = "compile"; + } result.add(new Dependency(new DefaultArtifact(coords.getGroupId(), - coords.getArtifactId(), coords.getClassifier(), coords.getType(), coords.getVersion()), "compile", null, + coords.getArtifactId(), coords.getClassifier(), coords.getType(), coords.getVersion()), scope, null, exclusions)); } return result; diff --git a/platform-bom/src/main/java/io/quarkus/bom/platform/DependencySpec.java b/platform-bom/src/main/java/io/quarkus/bom/platform/DependencySpec.java index dcc946fb..611fcf11 100644 --- a/platform-bom/src/main/java/io/quarkus/bom/platform/DependencySpec.java +++ b/platform-bom/src/main/java/io/quarkus/bom/platform/DependencySpec.java @@ -6,6 +6,7 @@ public class DependencySpec { private String artifact; + private String scope; private List exclusions = Collections.emptyList(); public String getArtifact() { @@ -16,6 +17,14 @@ public void setArtifact(String artifact) { this.artifact = artifact; } + public String getScope() { + return scope; + } + + public void setScope(String scope) { + this.scope = scope; + } + public List getExclusions() { return exclusions; } @@ -26,13 +35,19 @@ public void setExclusions(List exclusions) { @Override public String toString() { - if (exclusions.isEmpty()) { + if (exclusions.isEmpty() && (scope == null || scope.isEmpty())) { return artifact; } final StringBuilder s = new StringBuilder(); - s.append(artifact).append(" exclusions: ").append(exclusions.get(0)); - for (int i = 1; i < exclusions.size(); ++i) { - s.append(',').append(exclusions.get(i)); + s.append(artifact); + if (scope != null && !scope.isEmpty()) { + s.append('(').append(scope).append(')'); + } + if (!exclusions.isEmpty()) { + s.append(" exclusions: ").append(exclusions.get(0)); + for (int i = 1; i < exclusions.size(); ++i) { + s.append(',').append(exclusions.get(i)); + } } return s.toString(); }