{"record":{"id":"0ed0c1a9ff5cf73b","repo":"quarkusio/quarkus","slug":"unable-to-determine-groupid-and-artifactid-of-the-0ed0c1","errorCode":null,"errorMessage":"Unable to determine groupId and artifactId of the jar that contains ${clazz.getName()}","messagePattern":"Unable to determine groupId and artifactId of the jar that contains (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"core/deployment/src/main/java/io/quarkus/deployment/util/ArtifactInfoUtil.java","lineNumber":118,"sourceCode":"                if (isTargetClasses(location)) {\n                    Path mavenArchiver = location.getParent().resolve(\"maven-archiver\");\n                    if (mavenArchiver.toFile().canRead()) {\n                        Entry<String, String> ret = groupIdAndArtifactId(mavenArchiver);\n                        if (ret == null) {\n                            throw new RuntimeException(\n                                    \"Unable to determine groupId and artifactId of the extension that contains \"\n                                            + clazz.getName()\n                                            + \" because the directory doesn't contain the necessary metadata\");\n                        }\n                        return ret;\n                    }\n                }\n                return new AbstractMap.SimpleEntry<>(\"unspecified\", \"unspecified\");\n            } else {\n                return new AbstractMap.SimpleEntry<>(\"unspecified\", \"unspecified\");\n            }\n        } catch (IOException | URISyntaxException e) {\n            throw new RuntimeException(\"Unable to determine groupId and artifactId of the jar that contains \" + clazz.getName(),\n                    e);\n        }\n    }\n\n    /**\n     * Checks if the given path represents a Maven target/classes directory.\n     * This works for any module type (deployment, runtime, spi, etc.).\n     */\n    static boolean isTargetClasses(Path location) {\n        if (location == null || location.getFileName() == null) {\n            return false;\n        }\n        if (!location.getFileName().toString().equals(\"classes\")) {\n            return false;\n        }\n        Path target = location.getParent();\n        return !(target == null || target.getFileName() == null || !target.getFileName().toString().equals(\"target\"));\n    }","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/core/deployment/src/main/java/io/quarkus/deployment/util/ArtifactInfoUtil.java#L100-L136","documentation":"The catch-all failure of ArtifactInfoUtil.groupIdAndArtifactId: an IOException or URISyntaxException occurred while opening the class's jar/filesystem or reading its metadata. The RuntimeException wraps the original cause ('...caused by...') and reports the class whose jar coordinates could not be determined.","triggerScenarios":"The code location URI is malformed (URISyntaxException) or reading the jar filesystem fails (IOException): corrupt jar, jar deleted/moved between resolution and read, permission denied, unsupported URI scheme (e.g. jrt:/ or nested Spring Boot jar URLs).","commonSituations":"Running on JRE class library classes (jrt:/ URLs in Java 9+); nested-jar classloading schemes; race conditions where the jar is replaced during a hot redeploy; read-protected files or NFS-mounted repositories.","solutions":["Check the cause chain (getCause) to see whether it is IOException or URISyntaxException and fix the underlying file/URI problem","Ensure the class passed belongs to a plain jar file or file: directory, not a jrt:/ or nested-jar location","Verify the jar is readable and not corrupt (jar tf <file>)","Catch the RuntimeException and fall back to 'unspecified' coordinates when the info is optional"],"exampleFix":"// before\nvar ga = ArtifactInfoUtil.groupIdAndArtifactId(String.class); // jrt:/ location -> fails\n// after\nif (String.class.getProtectionDomain().getCodeSource() == null || !isPlainJar(String.class)) {\n    var ga = new AbstractMap.SimpleEntry<>(\"unspecified\", \"unspecified\");\n} else {\n    var ga = ArtifactInfoUtil.groupIdAndArtifactId(String.class);\n}","handlingStrategy":"try-catch","validationCode":"boolean resolvableCodeSource(Class<?> clazz) throws URISyntaxException {\n    var cs = clazz.getProtectionDomain().getCodeSource();\n    if (cs == null || cs.getLocation() == null) return false;\n    var uri = cs.getLocation().toURI();\n    return uri.getScheme().equals(\"file\") || uri.getScheme().equals(\"jar\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    var ga = ArtifactInfoUtil.groupIdAndArtifactId(clazz);\n} catch (RuntimeException e) {\n    // e.getCause() is IOException | URISyntaxException\n    log.warnf(e.getCause(), \"I/O failure resolving coordinates for %s\", clazz.getName());\n}","preventionTips":["Skip JDK/platform classes (jrt:/ locations) before resolving coordinates","Verify jar integrity (jar tf) after repository downloads","Avoid replacing jars while a build/test process holds them open","Guard with codeSource null/scheme checks before calling the utility"],"tags":["maven","io-exception","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"}