Skip to content

Commit

Permalink
Merge pull request #297 from basil/classifier
Browse files Browse the repository at this point in the history
Include classifier when computing final name
  • Loading branch information
jglick committed Feb 22, 2022
2 parents 5a9dd2c + 5318ed9 commit 1c1e31d
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/main/java/org/jenkinsci/maven/plugins/hpi/MavenArtifact.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,19 @@ public String getId() {
* @return converted filename of the artifact
*/
public String getDefaultFinalName() {
return artifact.getArtifactId() + "-" + artifact.getVersion() + "." +
artifact.getArtifactHandler().getExtension();
StringBuilder path = new StringBuilder();
path.append(artifact.getArtifactId());
path.append('-');
path.append(artifact.getVersion());
if (artifact.getClassifier() != null && !artifact.getClassifier().isEmpty()) {
path.append('-');
path.append(artifact.getClassifier());
}
if (!artifact.getArtifactHandler().getExtension().isEmpty()) {
path.append('.');
path.append(artifact.getArtifactHandler().getExtension());
}
return path.toString();
}

public boolean isOptional() {
Expand Down

0 comments on commit 1c1e31d

Please sign in to comment.