我有多模塊彈簧引導應用程序。我組織它的方式是它包含web
模塊,它具有@SpringBootApplication
類以及web
模塊(例如batch-jobs
模塊)導入的其他幾個模塊。Spring引導:子模塊依賴關係
web
模塊包含從春天啓動所有的依賴關係:
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...
我不知道我是否應該包括所有的彈簧引導啓動依賴這個模塊,或者最好是有純 Spring的依賴就像這裏:
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'
}
這些依賴關係是從上面的dependency-management
配置採取的。哪種方法更好?你能在這裏提供建議嗎?
是的。你對錯過依賴關係是正確的,但無論如何我會在更新Spring引導版本時檢查構建功能。 –