{"record":{"id":"176071054c65d1c2","repo":"apache/maven","slug":"groupid-can-neither-be-null-empty-nor-blank","errorCode":null,"errorMessage":"groupId can neither be null, empty nor blank","messagePattern":"groupId can neither be null, empty nor blank","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"warning","filePath":"compat/maven-artifact/src/main/java/org/apache/maven/artifact/ArtifactUtils.java","lineNumber":99,"sourceCode":"\n    public static String key(String groupId, String artifactId, String version) {\n        notBlank(groupId, \"groupId can neither be null, empty nor blank\");\n        notBlank(artifactId, \"artifactId can neither be null, empty nor blank\");\n        notBlank(version, \"version can neither be null, empty nor blank\");\n\n        return groupId + \":\" + artifactId + \":\" + version;\n    }\n\n    private static void notBlank(String str, String message) {\n        final int strLen = str != null ? str.length() : 0;\n        if (strLen > 0) {\n            for (int i = 0; i < strLen; i++) {\n                if (!Character.isWhitespace(str.charAt(i))) {\n                    return;\n                }\n            }\n        }\n        throw new IllegalArgumentException(message);\n    }\n\n    public static Map<String, Artifact> artifactMapByVersionlessId(Collection<Artifact> artifacts) {\n        Map<String, Artifact> artifactMap = new LinkedHashMap<>();\n\n        if (artifacts != null) {\n            for (Artifact artifact : artifacts) {\n                artifactMap.put(versionlessKey(artifact), artifact);\n            }\n        }\n\n        return artifactMap;\n    }\n\n    public static Artifact copyArtifactSafe(Artifact artifact) {\n        return (artifact != null) ? copyArtifact(artifact) : null;\n    }\n","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/compat/maven-artifact/src/main/java/org/apache/maven/artifact/ArtifactUtils.java#L81-L117","documentation":"The POM of a resolved dependency contains <distributionManagement><relocation>, meaning the artifact moved to new coordinates. When the relocated artifact is a direct dependency (dependency trail size 1), Maven logs this warning including the new groupId:artifactId:version plus any relocation message; for transitive dependencies the same text is logged at debug level only.","triggerScenarios":"A dependency declared directly in the project resolves to a POM whose <relocation> block points at different coordinates; Maven warns so you can update your declaration.","commonSituations":"javax to jakarta coordinate moves; a company groupId rename after an acquisition; library split-ups where old coordinates stay resolvable only as relocation stubs; the warning appearing right after a version bump.","solutions":["Update the <dependency> coordinates in your POM to the relocated groupId/artifactId shown in the warning","Read the appended relocation message: some relocations are deliberate bridges and need no action","For the transitive (debug-level) variant, manage the new coordinates in <dependencyManagement> and exclude the old ones"],"exampleFix":"<!-- before -->\n<dependency>\n  <groupId>com.oldcorp</groupId>\n  <artifactId>billing-client</artifactId>\n  <version>2.1.0</version>\n</dependency>\n<!-- after: relocated coordinates from the warning -->\n<dependency>\n  <groupId>com.newcorp</groupId>\n  <artifactId>billing-client</artifactId>\n  <version>2.1.0</version>\n</dependency>","handlingStrategy":"validation","validationCode":"# detect relocated direct dependencies after a version bump\nmvn -q dependency:tree -Dincludes=com.oldcorp:*\n# an empty tree means the old coordinates resolved only via relocation; update the POM","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run dependency:tree after upgrades and diff for coordinate changes","Inspect a dependency's POM for <relocation> before adopting it long-term","Watch release notes of major dependencies for coordinate moves"],"tags":["maven","relocation","dependencies","maven-compat"],"backgroundTag":"artifact-relocated","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}