Exclude by jar type when running and packaging with Maven
This commit updates the Maven Plugin to filter dependencies based on the Spring-Boot-Jar-Type entry in their manifest. Jars with a Spring-Boot-Jar-Type of dependencies-starter or annotation-processor are excluded. See gh-22036
This commit is contained in:
@@ -713,30 +713,6 @@ With Maven the dependency should be declared as optional, as shown in the follow
|
||||
</dependency>
|
||||
----
|
||||
|
||||
If you have defined `@ConfigurationProperties` in your application, make sure to configure the `spring-boot-maven-plugin` to prevent the `repackage` goal from adding the dependency into the fat jar:
|
||||
|
||||
[source,xml,indent=0,subs="verbatim,quotes,attributes"]
|
||||
----
|
||||
<project>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<excludes>
|
||||
<exclude>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||
</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
----
|
||||
|
||||
With Gradle 4.5 and earlier, the dependency should be declared in the `compileOnly` configuration, as shown in the following example:
|
||||
|
||||
[source,groovy,indent=0,subs="verbatim,quotes,attributes"]
|
||||
|
||||
Reference in New Issue
Block a user