Skip to content

Commit

Permalink
fix: dependency parsing in JBangBuilderImpl
Browse files Browse the repository at this point in the history
  • Loading branch information
iocanel committed Feb 8, 2023
1 parent 46ff02b commit ea6b0b7
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,17 @@ public static Map<String, Object> 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());
}
Expand Down

0 comments on commit ea6b0b7

Please sign in to comment.