Align library file naming mapping
This commit aligns the mapping from library to name to the default behaviour of the `maven-war-plugin`. Previously, our plugin would use the full version of the library (i.e. including build timestamp if there is one), rather than using the `baseVersion` property. Closes gh-7743
This commit is contained in:
parent
92d313f820
commit
022f7e86a0
|
@ -110,7 +110,7 @@ public class ArtifactsLibraries implements Libraries {
|
|||
|
||||
private String getFileName(Artifact artifact) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(artifact.getArtifactId()).append("-").append(artifact.getVersion());
|
||||
sb.append(artifact.getArtifactId()).append("-").append(artifact.getBaseVersion());
|
||||
String classifier = artifact.getClassifier();
|
||||
if (classifier != null) {
|
||||
sb.append("-").append(classifier);
|
||||
|
|
|
@ -114,14 +114,14 @@ public class ArtifactsLibrariesTests {
|
|||
given(artifact1.getScope()).willReturn("compile");
|
||||
given(artifact1.getGroupId()).willReturn("g1");
|
||||
given(artifact1.getArtifactId()).willReturn("artifact");
|
||||
given(artifact1.getVersion()).willReturn("1.0");
|
||||
given(artifact1.getBaseVersion()).willReturn("1.0");
|
||||
given(artifact1.getFile()).willReturn(new File("a"));
|
||||
given(artifact1.getArtifactHandler()).willReturn(this.artifactHandler);
|
||||
given(artifact2.getType()).willReturn("jar");
|
||||
given(artifact2.getScope()).willReturn("compile");
|
||||
given(artifact2.getGroupId()).willReturn("g2");
|
||||
given(artifact2.getArtifactId()).willReturn("artifact");
|
||||
given(artifact2.getVersion()).willReturn("1.0");
|
||||
given(artifact2.getBaseVersion()).willReturn("1.0");
|
||||
given(artifact2.getFile()).willReturn(new File("a"));
|
||||
given(artifact2.getArtifactHandler()).willReturn(this.artifactHandler);
|
||||
this.artifacts = new LinkedHashSet<Artifact>(Arrays.asList(artifact1, artifact2));
|
||||
|
|
Loading…
Reference in New Issue