Update docs about shade-plugin-setup and Boot 2.7

Add transformers for new auto configuration files introduced in Spring Boot 2.7. Update info about transformers not being required, if spring-boot-starter-parent is used

https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.7-Release-Notes#building-jars-with-maven-shade-plugin-and-gradle-shadow-plugin
This commit is contained in:
Andrzej Leśkiewicz
2022-09-28 11:58:58 +02:00
committed by GitHub
parent f2073600ad
commit 69a5a7fbe5

View File

@@ -106,8 +106,7 @@ manifest, using the `Start-Class` attribute (which will be added for you by the
tooling if you use the starter parent). If there is no `Start-Class` in your manifest you can
use an environment variable or system property `MAIN_CLASS` when you deploy the function to AWS.
If you are not using the functional bean definitions but relying on Spring Boot's auto-configuration,
then additional transformers must be configured as part of the maven-shade-plugin execution.
If you are not using the functional bean definitions but relying on Spring Boot's auto-configuration, and are not depending on `spring-boot-starter-parent`, then additional transformers must be configured as part of the maven-shade-plugin execution.
[[shade-plugin-setup]]
[source, xml]
@@ -119,7 +118,7 @@ then additional transformers must be configured as part of the maven-shade-plugi
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.7.1</version>
<version>2.7.4</version>
</dependency>
</dependencies>
<executions>
@@ -138,6 +137,12 @@ then additional transformers must be configured as part of the maven-shade-plugi
<transformer implementation="org.springframework.boot.maven.PropertiesMergingResourceTransformer">
<resource>META-INF/spring.factories</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring/org.springframework.boot.actuate.autoconfigure.web.ManagementContextConfiguration.imports</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.schemas</resource>
</transformer>