{"record":{"id":"cbfaa4e22d96901c","repo":"quarkusio/quarkus","slug":"codestart-artifact-is-missing-from-the-extension","errorCode":null,"errorMessage":"Codestart artifact is missing from the ${extensionFile}","messagePattern":"Codestart artifact is missing from the (.+?)","errorType":"exception","errorClass":"MojoExecutionException","httpStatus":null,"severity":"error","filePath":"independent-projects/extension-maven-plugin/src/main/java/io/quarkus/maven/ExtensionDescriptorMojo.java","lineNumber":637,"sourceCode":"\n    private ObjectNode readExtensionDescriptorFile(Path extensionFile, ObjectMapper mapper) throws MojoExecutionException {\n        try (InputStream is = Files.newInputStream(extensionFile)) {\n            return mapper.readValue(is, ObjectNode.class);\n        } catch (IOException io) {\n            throw new MojoExecutionException(\"Failed to parse \" + extensionFile, io);\n        }\n    }\n\n    private void completeCodestartArtifact(ObjectMapper mapper, ObjectNode extObject) throws MojoExecutionException {\n        JsonNode mvalue = getJsonElement(extObject, METADATA, \"codestart\");\n        if (mvalue == null || !mvalue.isObject()) {\n            return;\n        }\n        final ObjectNode codestartObject = (ObjectNode) mvalue;\n        mvalue = mvalue.get(\"artifact\");\n        if (mvalue == null) {\n            if (!skipCodestartValidation) {\n                throw new MojoExecutionException(\"Codestart artifact is missing from the \" + extensionFile);\n            }\n            return;\n        }\n\n        String codestartArtifact = getCodestartArtifact(mvalue.asText(), project.getVersion());\n        final ArtifactCoords codestartArtifactCoords = GACTV.fromString(codestartArtifact);\n        codestartObject.put(\"artifact\", codestartArtifactCoords.toString());\n        if (!skipCodestartValidation) {\n            // first we look for it in the workspace, if it's in there we don't need to actually resolve the artifact, because it might not have been built yet\n            if (workspaceProvider.getProject(codestartArtifactCoords.getGroupId(),\n                    codestartArtifactCoords.getArtifactId()) != null) {\n                return;\n            }\n            for (Artifact attached : project.getAttachedArtifacts()) {\n                if (codestartArtifactCoords.getArtifactId().equals(attached.getArtifactId()) &&\n                        codestartArtifactCoords.getClassifier().equals(attached.getClassifier()) &&\n                        codestartArtifactCoords.getType().equals(attached.getType()) &&\n                        codestartArtifactCoords.getVersion().equals(attached.getVersion()) &&","sourceCodeStart":619,"sourceCodeEnd":655,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/extension-maven-plugin/src/main/java/io/quarkus/maven/ExtensionDescriptorMojo.java#L619-L655","documentation":"completeCodestartArtifact requires that when the extension descriptor declares a metadata/codestart object, it also contains an \"artifact\" field pointing at the codestart artifact. If artifact is missing and skipCodestartValidation is false, execute() throws MojoExecutionException \"Codestart artifact is missing from the <file>\".","triggerScenarios":"extension.json/xml has a metadata.codestart object (e.g. only a \"name\" or other fields) but no \"artifact\" entry, and the extension-descriptor goal runs without -DskipCodestartValidation.","commonSituations":"Authoring a codestart section by hand and forgetting the artifact coordinate; removing the artifact line during refactoring; older descriptors migrated to a Quarkus version that enforces codestart artifact presence.","solutions":["Add the \"artifact\" field to metadata.codestart, e.g. \"artifact\": \"io.quarkus:quarkus-myext-codestart::jar:VERSION\" (version may be omitted to use the project version)","If the codestart artifact truly does not exist yet, set skipCodestartValidation=true temporarily","If no codestart is intended, remove the metadata.codestart object entirely"],"exampleFix":"// before\n\"codestart\": { \"name\": \"myext\" }\n// after\n\"codestart\": { \"name\": \"myext\", \"artifact\": \"org.acme:myext-codestart\" }","handlingStrategy":"validation","validationCode":"JsonNode cs = new ObjectMapper().readTree(extensionJson).path(\"metadata\").path(\"codestart\");\nif (cs.isObject() && cs.path(\"artifact\").isMissingNode() && !skipCodestartValidation) {\n  throw new IllegalStateException(\"codestart.artifact is required in \" + extensionJson);\n}","typeGuard":null,"tryCatchPattern":"try {\n  invoker.executeMaven(\"extension-descriptor\");\n} catch (MojoExecutionException e) {\n  if (e.getMessage().contains(\"Codestart artifact is missing\")) { addCodestartArtifactField(); }\n  throw e;\n}","preventionTips":["Always include both name and artifact in the metadata.codestart block","Generate codestart sections from a template extension rather than by hand","Run extension-descriptor locally before CI to catch validation early","If a codestart artifact does not exist, either omit the codestart object or pass skipCodestartValidation explicitly"],"tags":["maven-plugin","validation","codestart","extension-metadata"],"backgroundTag":"missing-required-metadata-field","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}