I am having a hard time determining whether I need to use org.springframework.boot dependencies, or use org.springframework dependencies and non-spring dependencies instead, in a non-spring boot application module such as a shared library.
At the moment I have 3 projects:
parent/
|-- client
| |-- pom.xml
| |-- src
|-- domain
| |-- pom.xml
| |-- src
|-- server
| |-- pom.xml
| |-- src
|-- pom.xml
My server is a Spring Boot Application that I use to serve web pages, and to use as a RESTless API (by using two different HttpSecurity configs).
My client is a Spring Boot CommandLineRunner Application that consumes the server's API service.
I have created the Domain module so that both the client and the server have access to the same versions of JPA Entities.
What I cannot figure out is when to use the org.springframework.boot dependency, and when to use the org.springframework and non-spring dependencies.
For example, in my domain module. I need some dependencies that I normally get through "org.springframework.boot::spring-boot-starter-jpa" and "org.springframework.boot::spring-boot-starter-security". But since the domain module is not a spring boot application. Should I use the non-spring-boot: "org.spring.framework.security::spring-security-core" dependency and the non-spring dependency "javax.persistence::persistence-api" instead?
What's the best practice? When to use springframework.boot dependencies and when to use springframework and non-spring dependencies? While staying as close to Spring as possible.