Skip to content

Commit 7c6d61e

Browse files
committed
Update documentation to mention execution id of repackage goal
This commit updates the documentation to reference the default execution id of the `repackage` goal when a project uses `spring-boot-starter-parent`. Closes gh-14835
1 parent 2c3e8de commit 7c6d61e

File tree

2 files changed

+78
-0
lines changed

2 files changed

+78
-0
lines changed

spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/site/apt/examples/custom-layout.apt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
<version>${project.version}</version>
2323
<executions>
2424
<execution>
25+
<id>repackage</id>
2526
<goals>
2627
<goal>repackage</goal>
2728
</goals>

spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/site/apt/examples/repackage-classifier.apt.vm

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
<version>${project.version}</version>
3030
<executions>
3131
<execution>
32+
<id>repackage</id>
3233
<goals>
3334
<goal>repackage</goal>
3435
</goals>
@@ -45,6 +46,38 @@
4546
</build>
4647
...
4748
</project>
49+
---
50+
51+
If you are using `spring-boot-starter-parent`, the `repackage` goal is executed
52+
automatically in an execution with id `repackage`. In that setup, only the configuration
53+
should be specified as shown in the following example:
54+
55+
---
56+
<project>
57+
...
58+
<build>
59+
...
60+
<plugins>
61+
...
62+
<plugin>
63+
<groupId>${project.groupId}</groupId>
64+
<artifactId>${project.artifactId}</artifactId>
65+
<executions>
66+
<execution>
67+
<id>repackage</id>
68+
<configuration>
69+
<classifier>exec</classifier>
70+
</configuration>
71+
</execution>
72+
</executions>
73+
...
74+
</plugin>
75+
...
76+
</plugins>
77+
...
78+
</build>
79+
...
80+
</project>
4881
---
4982

5083
This configuration will generate two artifacts: the original one and the repackaged
@@ -84,6 +117,7 @@
84117
<version>${project.version}</version>
85118
<executions>
86119
<execution>
120+
<id>repackage</id>
87121
<goals>
88122
<goal>repackage</goal>
89123
</goals>
@@ -106,5 +140,48 @@
106140
same phase, it is important that the jar plugin is defined first (so that it runs before
107141
the repackage goal).
108142

143+
Again, if you are using `spring-boot-starter-parent`, this can be simplified as follows:
144+
145+
---
146+
<project>
147+
...
148+
<build>
149+
...
150+
<plugins>
151+
...
152+
<plugin>
153+
<groupId>org.apache.maven.plugins</groupId>
154+
<artifactId>maven-jar-plugin</artifactId>
155+
<executions>
156+
<execution>
157+
<id>default-jar</id>
158+
<configuration>
159+
<classifier>task</classifier>
160+
</configuration>
161+
</execution>
162+
</executions>
163+
</plugin>
164+
<plugin>
165+
<groupId>${project.groupId}</groupId>
166+
<artifactId>${project.artifactId}</artifactId>
167+
<executions>
168+
<execution>
169+
<id>repackage</id>
170+
<configuration>
171+
<classifier>task</classifier>
172+
</configuration>
173+
</execution>
174+
</executions>
175+
...
176+
</plugin>
177+
...
178+
</plugins>
179+
...
180+
</build>
181+
...
182+
</project>
183+
---
184+
185+
109186

110187

0 commit comments

Comments
 (0)