quarkusio/quarkus · error · MojoExecutionException

The project artifact's extension is '${extension}' while thi

Error message

The project artifact's extension is '${extension}' while this goal expects it be 'jar'

What it means

BuildMojo.beforeExecute validates that the Maven project's artifact handler extension is 'jar' (skipping POM packaging earlier). If the artifact extension is anything else (e.g. 'war'), the Quarkus build goal cannot proceed and this MojoExecutionException is thrown.

Source

Thrown at devtools/maven/src/main/java/io/quarkus/maven/BuildMojo.java:102

    /**
     * The list of system properties defined for the plugin.
     */
    @Parameter
    Map<String, String> systemProperties = Collections.emptyMap();

    @Override
    protected boolean beforeExecute() throws MojoExecutionException {
        if (skip) {
            getLog().info("Skipping Quarkus build");
            return false;
        }
        if (mavenProject().getPackaging().equals(ArtifactCoords.TYPE_POM)) {
            getLog().info("Type of the artifact is POM, skipping build goal");
            return false;
        }
        if (!mavenProject().getArtifact().getArtifactHandler().getExtension().equals(ArtifactCoords.TYPE_JAR)) {
            throw new MojoExecutionException(
                    "The project artifact's extension is '" + mavenProject().getArtifact().getArtifactHandler().getExtension()
                            + "' while this goal expects it be 'jar'");
        }
        return true;
    }

    @Override
    protected void doExecute() throws MojoExecutionException {
        try {
            Set<String> propertiesToClear = new HashSet<>();

            // Add the system properties of the plugin to the system properties
            // if and only if they are not already set.
            for (Map.Entry<String, String> entry : systemProperties.entrySet()) {
                if (entry.getValue() == null) {
                    continue;
                }

View on GitHub (pinned to e1c734241f)

Solutions

  1. Change packaging back to jar (`<packaging>jar</packaging>`) for Quarkus applications.
  2. If a war is needed, use quarkus-rest / appropriate extensions and keep the Quarkus build on a jar-packaged module.
  3. Check that no plugin overrides the artifact handler extension in the POM.

Example fix

// before
<packaging>war</packaging>
// after
<packaging>jar</packaging>
Defensive patterns

Strategy: validation

Validate before calling

if (!'jar'.equals(project.getPackaging())) throw new IllegalStateException('quarkus:build requires jar packaging, got ' + project.getPackaging())

Try / catch

catch (MojoExecutionException e) { log.error('Packaging invalid for quarkus:build: ' + e.getMessage()); }

Prevention

When it happens

Trigger: Running quarkus:build on a project whose <packaging> yields an artifact handler extension other than 'jar' — most commonly war packaging or custom packaging types.

Common situations: Projects converted to war packaging but still running quarkus:build; custom packaging types in multi-module builds; misconfigured maven-war-plugin/maven-jar-plugin overriding the artifact handler.

Related errors


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