Disable attach of repackaged artifact

This commit allows to generate the packaged artifact only locally by
adding a new `attach` property. If `attach` is set to `false` explicitly,
only the main artifact is installed/deployed.

Closes gh-5258
This commit is contained in:
Stephane Nicoll
2016-03-01 11:12:59 +01:00
parent 2ecb33f7b4
commit 7f3ee2e405
9 changed files with 194 additions and 13 deletions

View File

@@ -0,0 +1,49 @@
-----
Local repackaged artifact
-----
Stephane Nicoll
-----
2016-03-01
-----
By default, the <<<repackage>>> goal will replace the original artifact with the
executable one. If you need to only deploy the original jar and yet be able to
run your app with the regular file name, configure the plugin as follows:
---
<project>
...
<build>
...
<plugins>
...
<plugin>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<version>${project.version}</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
<configuration>
<attach>false</attach>
</configuration>
</execution>
</executions>
...
</plugin>
...
</plugins>
...
</build>
...
</project>
---
This configuration will generate two artifacts: the original one and the executable counter
part produced by the repackage goal. Only the original one will be installed/deployed.

View File

@@ -42,6 +42,8 @@ Spring Boot Maven Plugin
* {{{./examples/repackage-classifier.html}Custom repackage classifier}}
* {{{./examples/repackage-disable-attach.html}Local repackaged artifact}}
* {{{./examples/exclude-dependency.html}Exclude a dependency}}
* {{{./examples/run-debug.html}Debug the application}}

View File

@@ -8,6 +8,7 @@
</menu>
<menu name="Examples">
<item name="Custom repackage classifier" href="examples/repackage-classifier.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"/>
<item name="Random port for integration tests" href="examples/it-random-port.html"/>