quarkusio/quarkus · error · IOException

Failed to located META-INF/maven/<groupId>/<artifactId>/pom.

Error message

Failed to located META-INF/maven/<groupId>/<artifactId>/pom.properties in 

What it means

ModelUtils.loadPomProps reads META-INF/maven/<groupId>/<artifactId>/pom.properties inside an application JAR to extract GAV coordinates. If the pom.properties file is missing it throws IOException. Maven writes this file during packaging unless the build explicitly disables it.

Source

Thrown at independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/maven/workspace/ModelUtils.java:242

    /**
     * If the model contains properties, this method overrides those that appear to be
     * defined as system properties.
     */
    public static Model applySystemProperties(Model model) {
        final Properties props = model.getProperties();
        for (Map.Entry<Object, Object> prop : model.getProperties().entrySet()) {
            final String systemValue = PropertyUtils.getProperty(prop.getKey().toString());
            if (systemValue != null) {
                props.put(prop.getKey(), systemValue);
            }
        }
        return model;
    }

    private static Properties loadPomProps(Path appJar, Path artifactIdPath) throws IOException {
        final Path propsPath = artifactIdPath.resolve("pom.properties");
        if (!Files.exists(propsPath)) {
            throw new IOException("Failed to located META-INF/maven/<groupId>/<artifactId>/pom.properties in " + appJar);
        }
        final Properties props = new Properties();
        try (BufferedReader reader = Files.newBufferedReader(propsPath)) {
            props.load(reader);
        }
        return props;
    }

    public static Model readModel(final Path pomXml) throws IOException {
        Model model = readModel(Files.newInputStream(pomXml));
        model.setPomFile(pomXml.toFile());
        return model;
    }

    public static Model readModel(InputStream stream) throws IOException {
        try (InputStream is = stream) {
            return new MavenXpp3Reader().read(is);
        } catch (XmlPullParserException e) {

View on GitHub (pinned to e1c734241f)

Solutions

  1. Build the JAR with Maven and default settings so pom.properties is embedded; check with `unzip -l app.jar | grep pom.properties`.
  2. Re-enable the descriptor: remove `addMavenDescriptor=false` from maven-jar-plugin config and any shade filters that exclude META-INF/maven.
  3. If coordinates come from elsewhere, resolve them without loadPomProps (e.g. from the repository metadata) rather than from the JAR.

Example fix

<!-- before -->
<plugin>
  <artifactId>maven-jar-plugin</artifactId>
  <configuration>
    <addMavenDescriptor>false</addMavenDescriptor>
  </configuration>
</plugin>
<!-- after: remove the flag (default true) -->
<plugin>
  <artifactId>maven-jar-plugin</artifactId>
</plugin>
Defensive patterns

Strategy: try-catch

Validate before calling

static boolean hasPomProperties(Path jar) throws IOException {
    try (var fs = ZipUtils.newFileSystem(jar)) {
        Path metaInfMaven = fs.getPath("META-INF", "maven");
        if (!Files.exists(metaInfMaven)) return false;
        try (var groups = Files.newDirectoryStream(metaInfMaven)) {
            for (Path g : groups) {
                try (var arts = Files.newDirectoryStream(g)) {
                    for (Path a : arts) {
                        if (Files.exists(a.resolve("pom.properties"))) return true;
                    }
                }
            }
        }
    }
    return false;
}

Try / catch

try {
    ResolvedDependency dep = ModelUtils.resolveAppArtifact(appJar);
} catch (IOException e) {
    // pom.properties missing; fall back to 'unknown' coordinates or repo metadata
}

Prevention

When it happens

Trigger: ModelUtils.resolveAppArtifact iterating META-INF/maven/<groupId>/<artifactId>/ directories in a JAR where a group/artifact directory exists but pom.properties was deleted/never written (maven-jar-plugin `addMavenDescriptor=false`, shaded jars, jars repackaged by other tools with race-y directory scanning where the dir exists but the props file was removed between the exists() check and load).

Common situations: JARs built with `<addMavenDescriptor>false</addMavenDescriptor>` or maven-shade-plugin filters stripping META-INF/maven; Gradle-built or manually packaged JARs; analyzing thin/relocated jars with the Quarkus bootstrap.

Related errors


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