Merge branch '2.1.x'

pull/16278/head
Stephane Nicoll 6 years ago
commit cba1e8ada0

@ -263,7 +263,8 @@ public class RepackageMojo extends AbstractDependencyFilterMojo {
if (!this.outputDirectory.exists()) {
this.outputDirectory.mkdirs();
}
return new File(this.outputDirectory, this.finalName + classifier + "."
String finalName = this.project.getBuild().getFinalName();
return new File(this.outputDirectory, finalName + classifier + "."
+ this.project.getArtifact().getArtifactHandler().getExtension());
}

@ -23,6 +23,7 @@
<version>${project.version}</version>
<executions>
<execution>
<id>repackage</id>
<goals>
<goal>repackage</goal>
</goals>

@ -0,0 +1,42 @@
-----
Repackage classifier
-----
Stephane Nicoll
-----
2019-03-29
-----
If you need the repackage jar to have a different local name than the one defined by
the <<<artifactId>>> attribute of the project, simply use the standard <<<finalName>>>
as shown in the following example:
---
<project>
...
<build>
<finalName>my-app</finalName>
<plugins>
...
<plugin>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<version>${project.version}</version>
<executions>
<execution>
<id>repackage</id>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
...
</plugin>
...
</plugins>
...
</build>
...
</project>
---
This configuration will generate the repackaged artifact in <<<target/my-app.jar>>>.

@ -46,6 +46,8 @@ Spring Boot Maven Plugin
* {{{./examples/repackage-classifier.html}Custom repackage classifier}}
* {{{./examples/repackage-name.html}Custom repackage name}}
* {{{./examples/repackage-disable-attach.html}Local repackaged artifact}}
* {{{./examples/exclude-dependency.html}Exclude a dependency}}

@ -8,6 +8,7 @@
</menu>
<menu name="Examples">
<item name="Custom repackage classifier" href="examples/repackage-classifier.html"/>
<item name="Custom repackage name" href="examples/repackage-name.html"/>
<item name="Local repackaged artifact" href="examples/repackage-disable-attach.html"/>
<item name="Exclude a dependency" href="examples/exclude-dependency.html"/>
<item name="Debug the application" href="examples/run-debug.html"/>

Loading…
Cancel
Save