Commit f25ce8a3 authored by Stephane Nicoll's avatar Stephane Nicoll

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
parent 160f2d34
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -187,7 +187,7 @@ public class RepackageMojo extends AbstractDependencyFilterMojo { ...@@ -187,7 +187,7 @@ public class RepackageMojo extends AbstractDependencyFilterMojo {
classifier = "-" + classifier; classifier = "-" + classifier;
} }
return new File(this.outputDirectory, this.finalName + classifier + "." return new File(this.outputDirectory, this.finalName + classifier + "."
+ this.project.getPackaging()); + this.project.getArtifact().getArtifactHandler().getExtension());
} }
public static enum LayoutType { public static enum LayoutType {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment