You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Automatically filter additional-spring-configuration-metadata.json from Spring Boot-built archives #27430
@wilkinsona pointed out that this information is indeed merged in the main metadata file.
I’m not sure how we can prevent this file from being packaged with the library. Is there anything we can do here? Maybe document how to filter out this file in the build?
changed the title [-]remove `additional-spring-configuration-metadata.json` from the jar of the spring-boot application[/-][+]Remove `additional-spring-configuration-metadata.json` from the jar[/+]on Jul 22, 2021
I think it would be nice to avoid bundling the additional metadata file by default if we can.
It would be straightforward in our own build, but I'm not sure it's possible to do it automatically for users while using a location beneath src/main/resources. They could be building a shared module without our Maven or Gradle plugins so we don't have a chance to filter things.
The only other option that I can think of is to use a location outside src/main/resources for the metadata as suggested above. I wonder about the additional complexity of this, though, and the possible impact on up-to-date checks and incremental compilation with Gradle.
We're going to update the Maven and Gradle plugins to filter out the file automatically. We'll also update the documentation to suggest that anyone building a library without our plugins configures their build to do the same.
changed the title [-]Remove `additional-spring-configuration-metadata.json` from the jar[/-][+]Automatically filter `additional-spring-configuration-metadata.json` from Spring Boot-built archives[/+]on Jul 26, 2021
Activity
bclozel commentedon Jul 21, 2021
This file is packaged with your project to provide additional information to developers when working with your library, as explained in our reference documentation.
Not packaging it with the library would make that file useless.
bclozel commentedon Jul 21, 2021
@wilkinsona pointed out that this information is indeed merged in the main metadata file.
I’m not sure how we can prevent this file from being packaged with the library. Is there anything we can do here? Maybe document how to filter out this file in the build?
wangliang181230 commentedon Jul 22, 2021
Can put the
additional-spring-configuration-metadata.jsonin thesrc/main/xxxdirectory? Not the/src/main/resources/META-INFdirectory.wangliang181230 commentedon Jul 22, 2021
Outside the
/src/main/resourcesdirectory, I think it will not be packaged into the library.[-]remove `additional-spring-configuration-metadata.json` from the jar of the spring-boot application[/-][+]Remove `additional-spring-configuration-metadata.json` from the jar[/+]bclozel commentedon Jul 22, 2021
I'm not sure the annotation processor will be able to find these files if they're not shipped as resources.
wangliang181230 commentedon Jul 22, 2021
Can the Maven plugin merge the metadata?
wangliang181230 commentedon Jul 23, 2021
@bclozel The
maven-jar-plugincan excludeadditional, and is merged to the main metadata.2 remaining items
wilkinsona commentedon Jul 26, 2021
I think it would be nice to avoid bundling the additional metadata file by default if we can.
It would be straightforward in our own build, but I'm not sure it's possible to do it automatically for users while using a location beneath
src/main/resources. They could be building a shared module without our Maven or Gradle plugins so we don't have a chance to filter things.The only other option that I can think of is to use a location outside
src/main/resourcesfor the metadata as suggested above. I wonder about the additional complexity of this, though, and the possible impact on up-to-date checks and incremental compilation with Gradle.wilkinsona commentedon Jul 26, 2021
We're going to update the Maven and Gradle plugins to filter out the file automatically. We'll also update the documentation to suggest that anyone building a library without our plugins configures their build to do the same.
[-]Remove `additional-spring-configuration-metadata.json` from the jar[/-][+]Automatically filter `additional-spring-configuration-metadata.json` from Spring Boot-built archives[/+]wilkinsona commentedon Sep 3, 2026
Closing in favor of #51386.