quarkusio/quarkus · error · MojoExecutionException

Codestart artifact is missing from the ${extensionFile}

Error message

Codestart artifact is missing from the ${extensionFile}

What it means

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>".

Source

Thrown at independent-projects/extension-maven-plugin/src/main/java/io/quarkus/maven/ExtensionDescriptorMojo.java:637

    private ObjectNode readExtensionDescriptorFile(Path extensionFile, ObjectMapper mapper) throws MojoExecutionException {
        try (InputStream is = Files.newInputStream(extensionFile)) {
            return mapper.readValue(is, ObjectNode.class);
        } catch (IOException io) {
            throw new MojoExecutionException("Failed to parse " + extensionFile, io);
        }
    }

    private void completeCodestartArtifact(ObjectMapper mapper, ObjectNode extObject) throws MojoExecutionException {
        JsonNode mvalue = getJsonElement(extObject, METADATA, "codestart");
        if (mvalue == null || !mvalue.isObject()) {
            return;
        }
        final ObjectNode codestartObject = (ObjectNode) mvalue;
        mvalue = mvalue.get("artifact");
        if (mvalue == null) {
            if (!skipCodestartValidation) {
                throw new MojoExecutionException("Codestart artifact is missing from the " + extensionFile);
            }
            return;
        }

        String codestartArtifact = getCodestartArtifact(mvalue.asText(), project.getVersion());
        final ArtifactCoords codestartArtifactCoords = GACTV.fromString(codestartArtifact);
        codestartObject.put("artifact", codestartArtifactCoords.toString());
        if (!skipCodestartValidation) {
            // 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
            if (workspaceProvider.getProject(codestartArtifactCoords.getGroupId(),
                    codestartArtifactCoords.getArtifactId()) != null) {
                return;
            }
            for (Artifact attached : project.getAttachedArtifacts()) {
                if (codestartArtifactCoords.getArtifactId().equals(attached.getArtifactId()) &&
                        codestartArtifactCoords.getClassifier().equals(attached.getClassifier()) &&
                        codestartArtifactCoords.getType().equals(attached.getType()) &&
                        codestartArtifactCoords.getVersion().equals(attached.getVersion()) &&

View on GitHub (pinned to e1c734241f)

Solutions

  1. 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)
  2. If the codestart artifact truly does not exist yet, set skipCodestartValidation=true temporarily
  3. If no codestart is intended, remove the metadata.codestart object entirely

Example fix

// before
"codestart": { "name": "myext" }
// after
"codestart": { "name": "myext", "artifact": "org.acme:myext-codestart" }
Defensive patterns

Strategy: validation

Validate before calling

JsonNode cs = new ObjectMapper().readTree(extensionJson).path("metadata").path("codestart");
if (cs.isObject() && cs.path("artifact").isMissingNode() && !skipCodestartValidation) {
  throw new IllegalStateException("codestart.artifact is required in " + extensionJson);
}

Try / catch

try {
  invoker.executeMaven("extension-descriptor");
} catch (MojoExecutionException e) {
  if (e.getMessage().contains("Codestart artifact is missing")) { addCodestartArtifactField(); }
  throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


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