quarkusio/quarkus · error · RuntimeException

Invalid artifact ${artifact}

Error message

Invalid artifact ${artifact}

What it means

JBangBuilderImpl.postBuild() parses user-supplied dependency coordinates of the form groupId:artifactId[:classifier:extension:]version. If a value splits into an unsupported number of parts (not 3, 4, or 5 colon-separated segments), it throws RuntimeException("Invalid artifact " + key).

Source

Thrown at independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/jbang/JBangBuilderImpl.java:81

                    .setMavenArtifactResolver(quarkusResolver)
                    .setProjectRoot(pomFile.getParent())
                    .setTargetDirectory(target)
                    .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[2], parts[3], parts[4]);
                        } else {
                            throw new RuntimeException("Invalid artifact " + s.getKey());
                        }
                        //artifact.setPath(s.getValue());
                        return artifact;
                    }).collect(Collectors.toList()))
                    .setAppArtifact(appArtifact)
                    .setIsolateDeployment(true)
                    .setBuildSystemProperties(configurationProperties)
                    .setRuntimeProperties(configurationProperties)
                    .setMode(QuarkusBootstrap.Mode.PROD);

            CuratedApplication app = builder
                    .build().bootstrap();

            if (nativeImage) {
                System.setProperty("quarkus.native.enabled", "true");
            }
            Map<String, Object> output = new HashMap<>();
            app.runInAugmentClassLoader("io.quarkus.deployment.jbang.JBangAugmentorImpl", output);

View on GitHub (pinned to e1c734241f)

Solutions

  1. Supply the artifact as groupId:artifactId:version (3 parts) or with classifier/extension as 4–5 parts
  2. Remove extra colon-separated segments such as scope or packaging not covered by the 5-part format
  3. Escape or strip any stray colons from the configured value

Example fix

// before
org.acme:mylib
// after
org.acme:mylib:1.0.0
Defensive patterns

Strategy: validation

Validate before calling

static void validateArtifactCoords(String s) {
    int parts = s.split(":", -1).length;
    if (parts < 3 || parts > 5)
        throw new IllegalArgumentException("Artifact must have 3-5 colon-separated parts: " + s);
}

Prevention

When it happens

Trigger: A dependency entry in the JBang configuration (map key) contains too few or too many ':' separated parts, e.g. 'org.acme:foo' (2 parts) or 'a:b:c:d:e:f' (6 parts).

Common situations: Typos in dependency strings; using GAV without version; accidentally including an extra colon; copying Maven-style coordinates with scope or other extra fields.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/5f679ad22f394dbe. Report an issue: GitHub.