apache/maven · warning

Could not parse META-INF/maven/org.apache.maven/maven-core/p

Error message

Could not parse META-INF/maven/org.apache.maven/maven-core/pom.properties, Maven runtime information not available

What it means

The pom.properties resource of maven-core was found on the classpath, but Properties.load() threw an IOException while parsing it; this warning (with the stack trace, since it is emitted under isDebugEnabled) records the failure and the version falls back to empty. Causes are physical corruption of the file: truncated download, wrong encoding (java.util.Properties requires ISO-8859-1 or UTF-8 with Java 9+ loader rules), or a jar entry that is not a valid key=value stream.

Source

Thrown at impl/maven-core/src/main/java/org/apache/maven/rtinfo/internal/DefaultRuntimeInformation.java:75

    public String getMavenVersion() {
        return mavenVersion;
    }

    private String loadMavenVersion() {
        Properties props = new Properties();

        String resource = "META-INF/maven/org.apache.maven/maven-core/pom.properties";

        try (InputStream is = DefaultRuntimeInformation.class.getResourceAsStream("/" + resource)) {
            if (is != null) {
                props.load(is);
            } else {
                logger.warn("Could not locate " + resource + " on classpath, Maven runtime information not available");
            }
        } catch (IOException e) {
            String msg = "Could not parse " + resource + ", Maven runtime information not available";
            if (logger.isDebugEnabled()) {
                logger.warn(msg, e);
            } else {
                logger.warn(msg);
            }
        }

        String version = props.getProperty("version", "").trim();

        if (!version.startsWith("${")) {
            return version;
        } else {
            return "";
        }
    }

    @Override
    public boolean isMavenVersion(String versionRange) {
        if (Objects.requireNonNull(versionRange, "versionRange cannot be null").isEmpty()) {
            throw new IllegalArgumentException("versionRange cannot be empty");

View on GitHub (pinned to e4093d4e12)

Solutions

  1. Run with -X to see the IOException stack trace and the exact parse failure
  2. Purge and re-download the corrupted artifact: delete the maven-core directory in the offending jar's origin (distribution lib/ or local repo) and restore from a clean source
  3. Reinstall the Maven distribution from an official mirror and verify the checksum
  4. In embedding code, treat an empty getMavenVersion() as 'unknown' instead of failing

Example fix

# before: corrupted jar silently reports no version
mvn -v   # Maven version line blank / runtime info missing

# after: reinstall distribution and re-download artifacts
rm -rf ~/.m2/repository/org/apache/maven
tar xzf apache-maven-3.9.9-bin.tar.gz && apache-maven-3.9.9/bin/mvn -v
Defensive patterns

Strategy: fallback

Validate before calling

// Robust version handling when pom.properties may be corrupt
String version = runtimeInformation.getMavenVersion();
if (version == null || version.isBlank() || version.startsWith("${")) {
    version = defaultVersion; // injected constant, e.g. the version you built against
    log.warn("Maven runtime information unavailable; assuming {}", version);
}

Prevention

When it happens

Trigger: getResourceAsStream returns a non-null stream but props.load(is) raises IOException: a half-written maven-core jar after an interrupted download, a jar repackaged with a broken entry, or tooling that rewrote pom.properties into a format Properties cannot parse.

Common situations: Broken artifact cache after a network drop mid-download (local repo jar truncated); docker image layers mangled by an incomplete COPY; CI caches poisoned with corrupted jars; company-wide artifact proxies serving partial content.

Related errors


AI-assisted analysis of apache/maven@e4093d4e12 (2026-08-21). Data as JSON: /api/errors/69a0ddf415bc6fd7. Report an issue: GitHub.