You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "elharo (via GitHub)" <gi...@apache.org> on 2026/07/29 13:49:57 UTC

[I] [maven-4.0.x] ArtifactCoordinates.getId() produces double colon when classifier is empty [maven]

elharo opened a new issue, #12596:
URL: https://github.com/apache/maven/issues/12596

   # ArtifactCoordinates.getId() produces double colon when classifier is empty
   
   **Found in:** maven-4.0.x branch
   **File:** `api/maven-api-core/src/main/java/org/apache/maven/api/ArtifactCoordinates.java` (lines ~72-78)
   **Severity:** High
   
   ## Description
   
   When `getClassifier()` returns an empty string (the standard case), `getId()` produces a double colon:
   
   ```java
   default String getId() {
       String c = getClassifier();
       return getGroupId() + ':' + getArtifactId() + ':' + getExtension()
               + ':' + c      // always adds ":" + c, even when empty
               + (c.isEmpty() ? "" : ":")
               + getVersionConstraint();
   }
   ```
   
   This produces `groupId:artifactId:extension::versionConstraint` — a double colon. Compare with the correct `Artifact.key()` method which correctly produces `groupId:artifactId:extension:version` when the classifier is empty.
   
   The fix should match the pattern in `Artifact.key()`:
   ```java
   return getGroupId() + ':' + getArtifactId() + ':' + getExtension()
           + (c.isEmpty() ? "" : ":" + c)
           + ':' + getVersionConstraint();
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [maven-4.0.x] ArtifactCoordinates.getId() produces double colon when classifier is empty [maven]

Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet closed issue #12596: [maven-4.0.x] ArtifactCoordinates.getId() produces double colon when classifier is empty
URL: https://github.com/apache/maven/issues/12596


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org