{"record":{"id":"62aa9c51d604d4f7","repo":"quarkusio/quarkus","slug":"failed-to-located-meta-inf-maven-groupid-artifa","errorCode":null,"errorMessage":"Failed to located META-INF/maven/<groupId>/<artifactId>/pom.xml in ${appJar}","messagePattern":"Failed to located META-INF/maven/<groupId>/<artifactId>/pom\\.xml in (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/maven/workspace/ModelUtils.java","lineNumber":126,"sourceCode":"                    for (Path groupIdPath : groupIds) {\n                        if (!Files.isDirectory(groupIdPath)) {\n                            continue;\n                        }\n                        try (DirectoryStream<Path> artifactIds = Files.newDirectoryStream(groupIdPath)) {\n                            for (Path artifactIdPath : artifactIds) {\n                                if (!Files.isDirectory(artifactIdPath)) {\n                                    continue;\n                                }\n                                final Path pomXml = artifactIdPath.resolve(\"pom.xml\");\n                                if (Files.exists(pomXml)) {\n                                    return readModel(pomXml);\n                                }\n                            }\n                        }\n                    }\n                }\n            }\n            throw new IOException(\"Failed to located META-INF/maven/<groupId>/<artifactId>/pom.xml in \" + appJar);\n        }\n    }\n\n    public static String getGroupId(Model model) {\n        String groupId = model.getGroupId();\n        if (groupId != null) {\n            return groupId;\n        }\n        final Parent parent = model.getParent();\n        if (parent != null) {\n            groupId = parent.getGroupId();\n            if (groupId != null) {\n                return groupId;\n            }\n        }\n        throw new IllegalStateException(\"Failed to determine groupId for project model\");\n    }\n","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/maven/workspace/ModelUtils.java#L108-L144","documentation":"ModelUtils.readAppModel(Path appJar) opens the JAR as a zip filesystem and scans META-INF/maven/<groupId>/<artifactId>/ for an embedded pom.xml. If the JAR has no such embedded POM descriptor, it throws IOException. Maven only embeds these descriptors for artifacts built with the default Maven lifecycle, so the JAR is not a (complete) Maven-built artifact.","triggerScenarios":"Calling ModelUtils.readAppModel on a JAR that was not produced by `mvn package` (e.g. shaded/uber/relocated/obfuscated jars, jars built by Gradle or hand-assembled, or artifacts whose META-INF/maven directory was stripped), or where META-INF/maven exists but contains no <groupId>/<artifactId>/pom.xml entry.","commonSituations":"Provisioning or analyzing a third-party or dependency-relocated JAR with the Quarkus bootstrap; testing with an application JAR built outside Maven; a build pipeline that filters/rewrites META-INF; spring-boot style repackaged jars with different descriptor layout.","solutions":["Ensure the application JAR is built by Maven so META-INF/maven/<groupId>/<artifactId>/pom.xml is embedded (check the JAR: `unzip -l app.jar | grep META-INF/maven`).","If the JAR was filtered/relocated, configure the build to keep META-INF/maven (e.g. shade plugin filter excludes that strip it).","If the artifact is a plain third-party library, do not call readAppModel on it — resolve its model from the repository instead of the JAR."],"exampleFix":"// before: reading a shaded jar\nclassifierJar = Path.of(\"target/app-1.0-shaded.jar\");\nModel m = ModelUtils.readAppModel(classifierJar); // IOException\n// after: use the original (non-shaded) artifact built by Maven\nclassifierJar = Path.of(\"target/app-1.0.jar\");\nModel m = ModelUtils.readAppModel(classifierJar);","handlingStrategy":"try-catch","validationCode":"static boolean hasEmbeddedPom(Path jar) throws IOException {\n    try (FileSystem fs = ZipUtils.newFileSystem(jar)) {\n        Path metaInfMaven = fs.getPath(\"META-INF\", \"maven\");\n        if (!Files.exists(metaInfMaven)) return false;\n        try (var groups = Files.newDirectoryStream(metaInfMaven)) {\n            for (Path g : groups) {\n                try (var arts = Files.newDirectoryStream(g)) {\n                    for (Path a : arts) {\n                        if (Files.exists(a.resolve(\"pom.xml\"))) return true;\n                    }\n                }\n            }\n        }\n    }\n    return false;\n}","typeGuard":"static boolean isMavenBuiltJar(Path jar) throws IOException {\n    try (var fs = ZipUtils.newFileSystem(jar)) {\n        return Files.exists(fs.getPath(\"META-INF\", \"maven\"));\n    }\n}","tryCatchPattern":"try {\n    Model model = ModelUtils.readAppModel(appJar);\n} catch (IOException e) {\n    // jar lacks META-INF/maven/<g>/<a>/pom.xml; resolve model from repo instead\n}","preventionTips":["Only feed Maven-packaged artifacts to readAppModel; check with `unzip -l app.jar | grep META-INF/maven`.","Avoid shaded/repackaged jars when application-model parsing is needed.","Keep addMavenDescriptor at its default (true) in jar plugin config."],"tags":["maven","jar","missing-resource","quarkus-bootstrap"],"backgroundTag":"missing-maven-descriptor-in-jar","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}