2

We have a pretty large codebase developed on Spring Boot and over the course of time, we have kept adding starters as required. I am going through a bit of housekeeping and have noticed that there are quite a bit of overlap in the dependencies provided by the starters. For eg. for creating a REST API, we started out with the spring-boot-starter-web and later added spring-boot-starter-data-rest. But I just noticed that spring-boot-starter-web is a direct dependency of spring-boot-starter-data-rest.

Now I know that as a best practice, if my code is using a library directly, that library should always be a direct dependency instead of relying on another library depending on it. But Spring Boot starters are just a BOM so I am wondering if there is a better practice here.

Sayak Mukhopadhyay
  • 1,332
  • 2
  • 19
  • 34
  • This is entirely up to you. I personally tend to try to prune them unless I need to have a dependency listed to force a newer version, but that's just for general tidiness. The BOMiness doesn't really matter. – chrylis -cautiouslyoptimistic- Oct 31 '20 at 15:47

0 Answers0