From ea6b0b7a1453ce409b520ea0aeac215932b9bef5 Mon Sep 17 00:00:00 2001 From: Ioannis Canellos Date: Mon, 6 Feb 2023 14:27:28 +0200 Subject: [PATCH] fix: dependency parsing in JBangBuilderImpl --- .../java/io/quarkus/bootstrap/jbang/JBangBuilderImpl.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/jbang/JBangBuilderImpl.java b/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/jbang/JBangBuilderImpl.java index 28d6cc7018768..439eb6e98d3c3 100644 --- a/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/jbang/JBangBuilderImpl.java +++ b/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/jbang/JBangBuilderImpl.java @@ -61,13 +61,17 @@ public static Map postBuild(Path appClasses, Path pomFile, List< .setManagingProject(new GACTV("io.quarkus", "quarkus-bom", "", "pom", getQuarkusVersion())) .setForcedDependencies(dependencies.stream().map(s -> { String[] parts = s.getKey().split(":"); + // The format of maven coordinate used in what jbang calls `canonical` form. + // The form is described here: https://github.com/jbangdev/jbang/blob/main/src/main/java/dev/jbang/dependencies/MavenCoordinate.java#L118 + // Despite the fact that is non standard it's still used for compatibility reasons by the IntegrationManager: + // https://github.com/jbangdev/jbang/blob/main/src/main/java/dev/jbang/spi/IntegrationManager.java#L73 Dependency artifact; if (parts.length == 3) { artifact = new ArtifactDependency(parts[0], parts[1], null, ArtifactCoords.TYPE_JAR, parts[2]); } else if (parts.length == 4) { artifact = new ArtifactDependency(parts[0], parts[1], null, parts[2], parts[3]); } else if (parts.length == 5) { - artifact = new ArtifactDependency(parts[0], parts[1], parts[3], parts[2], parts[4]); + artifact = new ArtifactDependency(parts[0], parts[1], parts[2], parts[3], parts[4]); } else { throw new RuntimeException("Invalid artifact " + s.getKey()); }