spring-boot icon indicating copy to clipboard operation
spring-boot copied to clipboard

Generate org.springframework.boot.autoconfigure.AutoConfiguration.imports file automatically

Open rubasace opened this issue 3 years ago • 10 comments

This one isn't a big issue anyway but I feel like @AutoConfiguration annotation should be enough to indicate the intention of the developer to create an autoconfiguration that should be automatically registered.

Personally, I feel META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports might be redundant, though I might be missing some use cases the team has previously thought of. Even if the idea is for this not to happen automatically for some "user-protection" reasons, I believe it would be nice to offer a parameter on the annotation to opt-in. Something like register(boolean register) that can default to false.

rubasace avatar Jun 01 '22 14:06 rubasace

Thanks for raising this @rubasace. We've been thinking about extending our annotation processor, or create a dedicated one that would create this file automatically.

snicoll avatar Jun 01 '22 14:06 snicoll

Using the annotation processor to generate the AutoConfiguration.imports file was causing problems with incremental compilation for Eclipse users, so we've reverted the changes. We'll look into this again after the 3.0.0 release.

The commits to re-apply for this enhancement and #32222, in order, are:

  • https://github.com/spring-projects/spring-boot/commit/da4de7d67d442771704fba268f33fbc90aaaf1aa
  • https://github.com/spring-projects/spring-boot/commit/6b3b0dd3a6ac4818388e97e121de69a91e21657d
  • https://github.com/spring-projects/spring-boot/commit/95e62b7ff822d0179850b3eb9baf6f0e0d89eb2e
  • https://github.com/spring-projects/spring-boot/commit/9fe24fe6929099243ab8aecceeed88ed48b24860

scottfrederick avatar Sep 21 '22 19:09 scottfrederick

When reinstating this support, we need to consider the Eclipse problems described in https://github.com/spring-projects/spring-boot/issues/32404.

wilkinsona avatar Sep 22 '22 14:09 wilkinsona

Any recent update? This would really help with maintenance of auto-configuration modules 🚀

heruan avatar Jan 06 '25 11:01 heruan

No update, the Eclipse issue was a blocker for us and we've had higher priority issues to work on.

philwebb avatar Jan 06 '25 17:01 philwebb

META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports Every time I try to write a sdk for springboot3, I need to copy this file name. I really hate it.

nan-www avatar Jun 08 '25 05:06 nan-www

@nan-www if you have something constructive to say then we're more than happy to hear it. Otherwise, please vent elsewhere.

wilkinsona avatar Jun 08 '25 06:06 wilkinsona

@nan-www if you have something constructive to say then we're more than happy to hear it. Otherwise, please vent elsewhere.

Got it. I'm sorry for the previous complaint. One more question: where can I subscribe to the progress of this issue?

nan-www avatar Jun 08 '25 07:06 nan-www

By commenting on this issue GitHub should have automatically subscribed you to it already.

wilkinsona avatar Jun 08 '25 07:06 wilkinsona