{"record":{"id":"43a3b4aa1dadc5b7","repo":"quarkusio/quarkus","slug":"bom-version-was-not-provided","errorCode":null,"errorMessage":"BOM version was not provided","messagePattern":"BOM version was not provided","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"independent-projects/tools/devtools-common/src/main/java/io/quarkus/platform/tools/ToolsUtils.java","lineNumber":125,"sourceCode":"        }\n        int count = 0;\n        while (i >= 0) {\n            ++count;\n            i = str.indexOf(ch, i + 1);\n        }\n        return count;\n    }\n\n    public static ExtensionCatalog resolvePlatformDescriptorDirectly(String bomGroupId, String bomArtifactId, String bomVersion,\n            MavenArtifactResolver artifactResolver, MessageWriter log) {\n        return resolvePlatformDescriptorDirectly(bomGroupId, bomArtifactId, bomVersion, artifactResolver, log, 1);\n    }\n\n    private static ExtensionCatalog resolvePlatformDescriptorDirectly(String bomGroupId, String bomArtifactId,\n            String bomVersion,\n            MavenArtifactResolver artifactResolver, MessageWriter log, int registryPreference) {\n        if (bomVersion == null) {\n            throw new IllegalArgumentException(\"BOM version was not provided\");\n        }\n        Artifact catalogCoords = new DefaultArtifact(\n                bomGroupId == null ? ToolsConstants.DEFAULT_PLATFORM_BOM_GROUP_ID : bomGroupId,\n                (bomArtifactId == null ? ToolsConstants.DEFAULT_PLATFORM_BOM_ARTIFACT_ID : bomArtifactId)\n                        + BootstrapConstants.PLATFORM_DESCRIPTOR_ARTIFACT_ID_SUFFIX,\n                bomVersion, \"json\", bomVersion);\n\n        Path platformJson = null;\n        try {\n            log.debug(\"Resolving platform descriptor %s\", catalogCoords);\n            platformJson = artifactResolver.resolve(catalogCoords).getArtifact().getFile().toPath();\n        } catch (Exception e) {\n            if (bomGroupId == null && catalogCoords.getArtifactId().startsWith(\"quarkus-bom\")) {\n                catalogCoords = new DefaultArtifact(\n                        ToolsConstants.IO_QUARKUS,\n                        \"quarkus-bom\" + BootstrapConstants.PLATFORM_DESCRIPTOR_ARTIFACT_ID_SUFFIX,\n                        catalogCoords.getClassifier(), catalogCoords.getExtension(), catalogCoords.getVersion());\n                try {","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/tools/devtools-common/src/main/java/io/quarkus/platform/tools/ToolsUtils.java#L107-L143","documentation":"ToolsUtils.resolvePlatformDescriptorDirectly resolves a platform BOM's descriptor artifact; the version is mandatory because it is used both as the artifact version and classifier-like field. If bomVersion is null, IllegalArgumentException('BOM version was not provided') is thrown.","triggerScenarios":"Calling resolvePlatformDescriptorDirectly (directly or via the public resolvePlatformDescriptor overload) with a groupId/artifactId but null version; omitting the version when invoking platform descriptor resolution from tools that did not pass a platform version property.","commonSituations":"quarkus.platform.version not set in the build; custom tooling calling ToolsUtils.resolvePlatformDescriptor without the version argument; expecting the default BOM coordinates to imply a version (they only default groupId/artifactId).","solutions":["Pass the platform version explicitly, e.g. -Dquarkus.platform.version=<version> when invoking the tooling","Set quarkus.platform.version in the Maven/Gradle build configuration","If writing code against this API, guard/require the version argument before calling"],"exampleFix":"// before\nToolsUtils.resolvePlatformDescriptor(null, null, null, resolver, log, 0); // version null\n// after\nToolsUtils.resolvePlatformDescriptor(null, null, \"3.2.0.Final\", resolver, log, 0);","handlingStrategy":"validation","validationCode":"String version = props.getProperty(\"quarkus.platform.version\");\nif (version == null || version.isBlank()) {\n    throw new IllegalArgumentException(\"quarkus.platform.version must be set before resolving the platform descriptor\");\n}\nToolsUtils.resolvePlatformDescriptorDirectly(g, a, version, resolver, log, 0);","typeGuard":null,"tryCatchPattern":"try {\n    ExtensionCatalog cat = ToolsUtils.resolvePlatformDescriptorDirectly(g, a, v, resolver, log, 0);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().equals(\"BOM version was not provided\")) {\n        throw new IllegalStateException(\"Configure quarkus.platform.version (e.g. -Dquarkus.platform.version=3.2.0.Final)\", e);\n    }\n    throw e;\n}","preventionTips":["Always set quarkus.platform.version in pom.xml/build scripts using these tools","Null-check the version argument at API boundaries before calling resolution","Do not assume default BOM coordinates supply a version — only groupId/artifactId are defaulted"],"tags":["maven","bom","configuration","missing-version"],"backgroundTag":"missing-required-version","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}