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
pull/3241/head
Stephane Nicoll 10 years ago
parent 160f2d341f
commit f25ce8a381

@ -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"); * 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 {
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 {

Loading…
Cancel
Save