{"record":{"id":"efdafd7aad789fec","repo":"apache/maven","slug":"artifactid-can-neither-be-null-empty-nor-blank","errorCode":null,"errorMessage":"artifactId can neither be null, empty nor blank","messagePattern":"artifactId 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":"In the legacy wagon layer (DefaultWagonManager.get), a TransferFailedException was thrown while downloading the artifact: a transport-level failure such as authentication rejection, TLS handshake error, or unsupported protocol, not a plain 404. This branch runs when debug is enabled (-X), so the warning carries the full stack trace. The exception is retained and rethrown afterwards unless the file already exists locally, in which case the forced update is ignored.","triggerScenarios":"Downloading from a repository where settings.xml credentials are rejected (401), TLS certificates fail verification, a proxy blocks the connection, or the wagon provider for the URL scheme is missing, with -X/debug output turned on.","commonSituations":"Corporate Nexus/Artifactory with expired tokens; self-signed or rotated certificates; a <server> id in settings.xml that does not match the repository id; https repositories behind misconfigured corporate proxies.","solutions":["Read the stack trace included in the warning: the caused-by chain names the exact transport failure","Fix settings.xml: the <server><id> must equal the repository id shown in the message, and the credentials must be current","Test reachability outside Maven: curl -fL -u user:pass <repoUrl>/path/to/artifact","If the artifact already exists in the local repository the build continues; otherwise fix the transport issue and rerun with -U"],"exampleFix":"<!-- before: server id does not match the repository id in the warning -->\n<settings>\n  <servers>\n    <server><id>internal-repo</id><username>ci</username><password>token</password></server>\n  </servers>\n</settings>\n<!-- after: id matches repository id 'corp-releases' -->\n<settings>\n  <servers>\n    <server><id>corp-releases</id><username>ci</username><password>token</password></server>\n  </servers>\n</settings>","handlingStrategy":"retry","validationCode":"curl -fsS -u $USER:$PASS $REPO_URL/path/to/artifact-1.0.jar -o /dev/null \\\n  || echo 'transport broken; fix credentials/proxy before running mvn'","typeGuard":null,"tryCatchPattern":"for (int attempt = 1; attempt <= 3; attempt++) {\n    try {\n        resolver.resolveArtifact(session, request);   // embedder resolution API\n        break;\n    } catch (ArtifactTransferException e) {           // failure behind the warn\n        if (attempt == 3 || !isTransient(e)) {\n            throw e;                                  // give up loudly\n        }\n        TimeUnit.SECONDS.sleep(attempt);              // linear backoff, then retry\n    }\n}","preventionTips":["Keep settings.xml <server> ids exactly matching the repository ids they authenticate","Keep proxy definitions and trusted certificates current for every repository","Run with -X whenever investigating download warnings so the stack is captured"],"tags":["maven","wagon","download","authentication","maven-compat"],"backgroundTag":"artifact-download-failed","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}