From f25ce8a3810b52b560b864c40ee89622a931ca52 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Tue, 26 May 2015 16:21:00 +0200 Subject: [PATCH] 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 --- .../java/org/springframework/boot/maven/RepackageMojo.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/RepackageMojo.java b/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/RepackageMojo.java index fee5481c326..6b8a7bee152 100644 --- a/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/RepackageMojo.java +++ b/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/RepackageMojo.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2014 the original author or authors. + * Copyright 2012-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -187,7 +187,7 @@ public class RepackageMojo extends AbstractDependencyFilterMojo { classifier = "-" + classifier; } return new File(this.outputDirectory, this.finalName + classifier + "." - + this.project.getPackaging()); + + this.project.getArtifact().getArtifactHandler().getExtension()); } public static enum LayoutType {