{"record":{"id":"2fb0be62b225fdcf","repo":"quarkusio/quarkus","slug":"unable-to-determine-groupid-and-artifactid-of-the","errorCode":null,"errorMessage":"Unable to determine groupId and artifactId of the jar that contains ${clazz.getName()} because the jar doesn't contain the necessary metadata","messagePattern":"Unable to determine groupId and artifactId of the jar that contains (.+?) because the jar doesn't contain the necessary metadata","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"core/deployment/src/main/java/io/quarkus/deployment/util/ArtifactInfoUtil.java","lineNumber":85,"sourceCode":"                            Path jarParentDir = p.getParent(); // .../module/target (if JAR is in target dir)\n                            if (classesTargetDir != null && classesTargetDir.equals(jarParentDir)) {\n                                String artifactId = i.getArtifactId();\n                                if (artifactId.endsWith(DEPLOYMENT)) {\n                                    artifactId = artifactId.substring(0, artifactId.length() - DEPLOYMENT.length());\n                                }\n                                return new AbstractMap.SimpleEntry<>(i.getGroupId(), artifactId);\n                            }\n                        }\n                    }\n                }\n            }\n\n            if (codeLocation.toString().endsWith(\".jar\")) {\n                // Search inside the jar for pom properties, needed for workspace artifacts\n                try (FileSystem fs = ZipUtils.newFileSystem(Paths.get(codeLocation.toURI()))) {\n                    Entry<String, String> ret = groupIdAndArtifactId(fs);\n                    if (ret == null) {\n                        throw new RuntimeException(\"Unable to determine groupId and artifactId of the jar that contains \"\n                                + clazz.getName() + \" because the jar doesn't contain the necessary metadata\");\n                    }\n                    return ret;\n                }\n            } else if (\"file\".equals(codeLocation.getProtocol())) {\n                // E.g. /quarkus/extensions/arc/deployment/target/classes/io/quarkus/arc/deployment/devconsole\n                // This can happen if you run an example app in dev mode\n                // and this app is part of a multi-module project which also declares the extension\n                // Just try to locate the pom.properties file in the target/maven-archiver directory\n                // Note that this hack will not work if addMavenDescriptor=false or if the pomPropertiesFile is overridden\n                Path location = Paths.get(codeLocation.toURI());\n                while (!isTargetClasses(location) && location.getParent() != null) {\n                    location = location.getParent();\n                }\n                if (isTargetClasses(location)) {\n                    Path mavenArchiver = location.getParent().resolve(\"maven-archiver\");\n                    if (mavenArchiver.toFile().canRead()) {\n                        Entry<String, String> ret = groupIdAndArtifactId(mavenArchiver);","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/core/deployment/src/main/java/io/quarkus/deployment/util/ArtifactInfoUtil.java#L67-L103","documentation":"ArtifactInfoUtil.groupIdAndArtifactId resolves the Maven groupId:artifactId of the artifact containing a given class. When the class lives inside a .jar that has no POM metadata (maven/pom.properties or similar) embedded, this RuntimeException is thrown. Quarkus needs these coordinates mainly for Dev UI / console info about extensions.","triggerScenarios":"Calling ArtifactInfoUtil.groupIdAndArtifactId(Class) (or a variant) with a class whose code location is a jar lacking META-INF/maven/**/pom.properties — e.g. shaded/uber jars, jars built without Maven, or relocated dependency jars.","commonSituations":"Shaded dependencies (fat jars) where pom.properties was stripped; jars built by Gradle/sbt without Maven metadata; application classes packaged by a custom build; third-party jars repackaged by shadow plugin.","solutions":["Build the jar with Maven so META-INF/maven/<groupId>/<artifactId>/pom.properties is included, or configure the shade plugin to keep it","Return 'unspecified' handling upstream if the caller only needs best-effort coordinates — wrap in try-catch","Pass a class from a proper Maven-built extension artifact instead of a shaded jar","If it is your own artifact, verify the jar contents (unzip -l | grep pom.properties)"],"exampleFix":"// before\nEntry<String,String> ga = ArtifactInfoUtil.groupIdAndArtifactId(ShadedLib.class); // throws\n// after\nEntry<String,String> ga;\ntry {\n    ga = ArtifactInfoUtil.groupIdAndArtifactId(ShadedLib.class);\n} catch (RuntimeException e) {\n    ga = new AbstractMap.SimpleEntry<>(\"unspecified\", \"unspecified\");\n}","handlingStrategy":"try-catch","validationCode":"boolean jarHasMavenMetadata(Class<?> clazz) throws Exception {\n    var loc = clazz.getProtectionDomain().getCodeSource().getLocation();\n    if (loc == null || !loc.toString().endsWith(\".jar\")) return false;\n    try (var fs = java.nio.file.FileSystems.newFileSystem(java.nio.file.Paths.get(loc.toURI()), (ClassLoader) null);\n         var walk = java.nio.file.Files.walk(fs.getPath(\"META-INF/maven\"))) {\n        return walk.filter(p -> p.getFileName().toString().equals(\"pom.properties\")).findFirst().isPresent();\n    } catch (Exception e) { return false; }\n}","typeGuard":null,"tryCatchPattern":"try {\n    var ga = ArtifactInfoUtil.groupIdAndArtifactId(clazz);\n    use(ga.getKey(), ga.getValue());\n} catch (RuntimeException e) {\n    log.warnf(e, \"No Maven metadata for jar of %s; using unspecified\", clazz.getName());\n    use(\"unspecified\", \"unspecified\");\n}","preventionTips":["Avoid shipping shaded/uber jars for artifacts whose coordinates Quarkus must resolve","Keep META-INF/maven/** in shade/relocation plugin filters","Build library jars with Maven or explicitly add pom.properties","Prefer passing classes from Quarkus extension artifacts"],"tags":["maven","metadata","artifact-coordinates"],"backgroundTag":"missing-artifact-metadata","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"}