Ich habe Multi-Modul Spring Boot-Anwendung. Ich habe es so organisiert, dass es enthält web
Modul, das @SpringBootApplication
Klasse und mehrere andere Module, die von web
Modul (z. B. batch-jobs
Modul) importiert werden.Spring Boot: Submodul Abhängigkeit
web
Modul enthält alle Abhängigkeiten von Feder boot:
compile('org.springframework.boot:spring-boot-starter-batch')
compile('org.springframework.boot:spring-boot-starter-data-jpa')
compile('org.springframework.boot:spring-boot-starter-integration')
...
providedRuntime('org.springframework.boot:spring-boot-starter-tomcat')
testCompile('org.springframework.boot:spring-boot-starter-test')
etc...
Ich frage mich, ob ich alle Feder-boot-Starter-Abhängigkeiten in dieser Module enthalten sollte oder es ist besser reine Feder Abhängigkeiten zu haben wie hier:
dependencies {
compile 'org.springframework:spring-core'
compile 'org.springframework:spring-context'
compile 'org.springframework.integration:spring-integration-java-dsl'
compile 'org.springframework.batch:spring-batch-core'
...
testCompile 'org.springframework:spring-test'
testCompile 'org.springframework.integration:spring-integration-test'
}
Diese Abhängigkeiten werden sowieso aus der oberen dependency-management
Konfiguration übernommen. Welcher Ansatz ist besser? Kannst du bitte hier beraten?
Ja. Sie haben recht, wenn es um fehlende Abhängigkeiten geht, aber ich werde die Build-Funktionalität überprüfen, wenn ich Spring-Boot-Versionen aktualisiere. –