{"record":{"id":"cf0a3bc2c9271f45","repo":"quarkusio/quarkus","slug":"key-isn-t-found-in-the-extension-map","errorCode":null,"errorMessage":"${key} isn't found in the extension map","messagePattern":"(.+?) isn't found in the extension map","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/project/update/ExtensionMapBuilder.java","lineNumber":46,"sourceCode":"        list.add(e);\n    }\n\n    public ExtensionUpdateInfoBuilder get(ArtifactKey key) {\n        final List<ExtensionUpdateInfoBuilder> list = extensionInfo.get(key.getArtifactId());\n        if (list == null || list.isEmpty()) {\n            return null;\n        }\n        if (list.size() == 1) {\n            return list.get(0);\n        }\n        for (ExtensionUpdateInfoBuilder e : list) {\n            final TopExtensionDependency recommendedDep = e.resolveRecommendedDep();\n            if (e.currentDep.getKey().equals(key)\n                    || recommendedDep != null && recommendedDep.getKey().equals(key)) {\n                return e;\n            }\n        }\n        throw new IllegalArgumentException(key + \" isn't found in the extension map\");\n    }\n\n    public Collection<ExtensionUpdateInfoBuilder> values() {\n        return list;\n    }\n\n    public int size() {\n        return extensionInfo.size();\n    }\n\n    public boolean isEmpty() {\n        return extensionInfo.isEmpty();\n    }\n\n    public static final class ExtensionUpdateInfoBuilder {\n        private final TopExtensionDependency currentDep;\n        private Extension recommendedMetadata;\n        private TopExtensionDependency recommendedDep;","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/project/update/ExtensionMapBuilder.java#L28-L64","documentation":"ExtensionMapBuilder.get(ArtifactKey) looks up an extension update entry keyed by artifactId. When the bucket for the artifactId holds multiple entries (same artifactId, different groupId), it disambiguates by exact key match against currentDep or the recommended dependency; if none matches the requested full key it throws IllegalArgumentException. In practice this signals a key mismatch within an artifactId collision.","triggerScenarios":"Calling ProjectUpdateInfos.resolveRecommendedState()/resolveExtensionsUpdateInfo() flows that look up an extension by ArtifactKey when two registered extensions share an artifactId but differ in groupId, and the queried key matches neither current nor recommended dependency key — typically after an extension was relocated/renamed to a different groupId.","commonSituations":"Projects referencing an extension under an old groupId after Quarkus relocated the artifact, custom forks of core extensions shadowing original artifactIds, mixing extensions from different registries with colliding artifactIds.","solutions":["Use the exact current groupId:artifactId of the installed extension in the lookup key (check pom.xml dependencies)","If the extension was relocated, update the dependency in the project to the new groupId so currentDep matches the recommended key","Check for duplicate extensions with the same artifactId in your dependency tree (mvn dependency:tree) and remove the stale one","Since this is internal devtools code triggered by resolveRecommendedState, ensure the registries' catalogs aren't returning mismatched keys (refresh registry cache)"],"exampleFix":"// before: lookup with legacy groupId\nArtifactKey key = ArtifactKey.fromString(\"io.quarkus:quarkus-resteasy\");\nbuilder.get(key); // IllegalArgumentException if installed as new groupId\n// after\nArtifactKey key = ArtifactKey.fromString(\"io.quarkus.ext:quarkus-resteasy\"); // groupId matching the installed dependency\nbuilder.get(key);","handlingStrategy":"validation","validationCode":"// before lookup\nArtifactKey fullKey = dep.getKey();\nboolean exists = extensionMap.values().stream()\n    .anyMatch(e -> e.getCurrentDep().getKey().equals(fullKey)\n        || e.resolveRecommendedDep().getKey().equals(fullKey));\nif (!exists) throw new IllegalStateException(\"Extension not registered: \" + fullKey);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always look up with the full groupId:artifactId of the actually installed dependency","After Quarkus relocations, migrate the project's groupId before running update flows","Check for duplicate artifactIds across different groupIds in the dependency tree","Prefer values()/isEmpty() checks before get() when collisions are possible"],"tags":["extensions","artifact-key","devtools","lookup"],"backgroundTag":"artifact-key-not-found","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"}