Filter additional configuration metadata from archives

Signed-off-by: Wan bin yu <3431359639@qq.com>

See gh-51386
This commit is contained in:
Wan bin yu
2026-09-09 08:30:08 +01:00
committed by Andy Wilkinson
parent 3a869d0645
commit 0d223cbc77
5 changed files with 82 additions and 4 deletions
@@ -192,3 +192,28 @@ The items contained in the "`ignored.properties`" section are removed from the "
The additional properties file is optional.
If you do not have any additional properties, do not add the file.
The Spring Boot Maven and Gradle plugins exclude `additional-spring-configuration-metadata.json` from the packaged artifact.
If you do not use either plugin to build your library, you should configure your build to exclude the file.
With Maven, you can configure the `maven-jar-plugin` as follows:
[source,xml]
----
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<excludes>
<exclude>META-INF/additional-spring-configuration-metadata.json</exclude>
</excludes>
</configuration>
</plugin>
----
With Gradle, you can configure the `jar` task as follows:
[source,gradle]
----
tasks.named('jar') {
exclude('META-INF/additional-spring-configuration-metadata.json')
}
----