quarkusio/quarkus · error · GradleException

Manifest entry name ${key} is invalid. " characters are not

Error message

Manifest entry name ${key} is invalid. " characters are not allowed.

What it means

Thrown by AbstractQuarkusExtension.toManifestAttributeKey() when a manifest attribute key configured via quarkus.package.jar.manifest.attributes contains a double-quote character. Quotes are illegal in manifest entry names because the property key is interpolated into a Gradle property name pattern.

Source

Thrown at devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/AbstractQuarkusExtension.java:175

            // gradleProperty instead of Project.getProperties().get(...), which is not allowed under
            // Isolated Projects.
            profile = project.getProviders().gradleProperty(QUARKUS_PROFILE).getOrNull();
        }
        if (profile == null) {
            profile = "prod";
        }
        return profile;
    }

    private static FileCollection dependencyClasspath(SourceSet mainSourceSet) {
        return mainSourceSet.getCompileClasspath().plus(mainSourceSet.getRuntimeClasspath())
                .plus(mainSourceSet.getAnnotationProcessorPath())
                .plus(mainSourceSet.getResources());
    }

    protected static String toManifestAttributeKey(String key) {
        if (key.contains("\"")) {
            throw new GradleException("Manifest entry name " + key + " is invalid. \" characters are not allowed.");
        }
        return String.format("%s.\"%s\"", MANIFEST_ATTRIBUTES_PROPERTY_PREFIX, key);
    }

    protected static String toManifestSectionAttributeKey(String section, String key) {
        if (section.contains("\"")) {
            throw new GradleException("Manifest section name " + section + " is invalid. \" characters are not allowed.");
        }
        if (key.contains("\"")) {
            throw new GradleException("Manifest entry name " + key + " is invalid. \" characters are not allowed.");
        }
        return String.format("%s.\"%s\".\"%s\"", MANIFEST_SECTIONS_PROPERTY_PREFIX, section,
                key);
    }
}

View on GitHub (pinned to e1c734241f)

Solutions

  1. Remove the double-quote character from the manifest attribute key
  2. Sanitize/validate user- or environment-supplied attribute names before passing them to Quarkus config
  3. Use valid JAR manifest attribute names (alphanumeric, dash, underscore) per the Jar file specification

Example fix

// before
quarkus.package.jar.manifest.attributes."My\"Attr"=value
// after
quarkus.package.jar.manifest.attributes."My-Attr"=value
Defensive patterns

Strategy: validation

Validate before calling

fun requireNoQuote(key: String) {
  require('"' !in key) { "Manifest attribute key must not contain quotes: $key" }
}

Type guard

def isSafeManifestKey(s: String): Boolean = s != null && !s.contains('"')

Try / catch

try { quarkusBuildTask.configureManifest() } catch (e: GradleException) {
  if (e.message?.startsWith("Manifest entry name") == true) {
    logger.error("Fix quoted manifest attribute key in quarkus.package.jar.manifest.attributes")
  } else throw e
}

Prevention

When it happens

Trigger: Defining a manifest attribute whose name includes '"', e.g. quarkus.package.jar.manifest.attributes."Some\"Key"=value, which is passed to toManifestAttributeKey during manifest configuration.

Common situations: Copy-pasting manifest attribute names with quoting typos; building property names dynamically from untrusted/user input containing quotes; YAML/properties escaping mistakes in application.properties.

Related errors


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