Skip to content

Commit f25ce8a

Browse files
committed
Fix artifact extension retrieval
Do not rely on the packaging type to figure out what the extension of the main artifact will be. So far, using `jar` and `war` packaging for `.jar` and `.war` files worked by chance. We know retrieve the actual extension as provided by Maven's `ArtifactHandler`. Fixes gh-2762
1 parent 160f2d3 commit f25ce8a

File tree

1 file changed

+2
-2
lines changed
  • spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven

1 file changed

+2
-2
lines changed

spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/RepackageMojo.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2014 the original author or authors.
2+
* Copyright 2012-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -187,7 +187,7 @@ private File getTargetFile() {
187187
classifier = "-" + classifier;
188188
}
189189
return new File(this.outputDirectory, this.finalName + classifier + "."
190-
+ this.project.getPackaging());
190+
+ this.project.getArtifact().getArtifactHandler().getExtension());
191191
}
192192

193193
public static enum LayoutType {

0 commit comments

Comments
 (0)