quarkusio/quarkus · error · ParameterException

Invalid value '%s' for option '--platform-bom'. Value should

Error message

Invalid value '%s' for option '--platform-bom'. Value should be specified as 'GROUP-ID:ARTIFACT-ID:VERSION'. %s

What it means

TargetQuarkusPlatformGroup.setPlatformBom parses the --platform-bom option with ArtifactCoords.fromString, expecting 'GROUP-ID:ARTIFACT-ID:VERSION'. Parse failures (IllegalArgumentException) are rethrown as a picocli ParameterException that echoes the input and the parser's explanation.

Source

Thrown at devtools/cli-common/src/main/java/io/quarkus/cli/common/TargetQuarkusPlatformGroup.java:77

                                ToolsConstants.DEFAULT_PLATFORM_BOM_ARTIFACT_ID,
                                VersionHelper.clientVersion());
                    } else {
                        // some.group::version, use default artifact id
                        setBom(bom.substring(0, firstPos),
                                ToolsConstants.DEFAULT_PLATFORM_BOM_ARTIFACT_ID,
                                bom.substring(lastPos + 1));
                    }
                } else if (firstPos == 0 && lastPos == bom.length() - 1) {
                    // :my-bom:, use default group and version
                    setBom(ToolsConstants.DEFAULT_PLATFORM_BOM_GROUP_ID,
                            bom.substring(1, lastPos),
                            VersionHelper.clientVersion());
                } else {
                    platformBom = ArtifactCoords.fromString(bom);
                    validPlatformBom = bom; // keep original (valid) string (dryrun)
                }
            } catch (IllegalArgumentException iex) {
                throw new CommandLine.ParameterException(spec.commandLine(),
                        String.format("Invalid value '%s' for option '--platform-bom'. " +
                                "Value should be specified as 'GROUP-ID:ARTIFACT-ID:VERSION'. %s", bom, iex.getMessage()));
            }
        }
    }

    public boolean isPlatformSpecified() {
        return platformBom != null;
    }

    public ArtifactCoords getPlatformBom() {
        return platformBom;
    }

    public boolean isStreamSpecified() {
        return streamCoords != null;
    }

View on GitHub (pinned to e1c734241f)

Solutions

  1. Provide all three segments: --platform-bom io.quarkus.platform:quarkus-bom:2.16.0.Final.
  2. If you only want a stream rather than an exact BOM, use --stream platformKey:streamId instead.
  3. Verify the version string exists (no stray spaces or characters) by checking Maven Central.

Example fix

// before
quarkus create app --platform-bom io.quarkus.platform demo
// after
quarkus create app --platform-bom io.quarkus.platform:quarkus-bom:2.16.0.Final demo
Defensive patterns

Strategy: validation

Validate before calling

public static boolean isValidBomCoord(String s) {
    if (s == null) return false;
    String[] p = s.trim().split(":");
    return p.length == 3 && !p[0].isEmpty() && !p[1].isEmpty() && !p[2].isEmpty();
}

Type guard

public static Optional<ArtifactCoords> tryParseBom(String s) {
    try { return Optional.of(ArtifactCoords.fromString(s.trim())); }
    catch (IllegalArgumentException e) { return Optional.empty(); }
}

Try / catch

try {
    createApp(opts);
} catch (CommandLine.ParameterException e) {
    if (e.getMessage() != null && e.getMessage().contains("--platform-bom")) {
        System.err.println("Expected GROUP-ID:ARTIFACT-ID:VERSION, e.g. io.quarkus.platform:quarkus-bom:2.16.0.Final");
    } else throw e;
}

Prevention

When it happens

Trigger: Passing --platform-bom a value that is not a well-formed 3-part coordinate: missing version, missing artifact id, extra segments, or illegal characters — e.g. `--platform-bom io.quarkus.platform`, `--platform-bom io.quarkus.platform:quarkus-bom:2.16.0.Final:extra`.

Common situations: Giving just the group or groupId:artifactId and forgetting the :VERSION; pasting a full Maven GAV with classifier; confusing --platform-bom with --stream syntax.

Related errors


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