2017-06-02 59 views
3

我有一個多模塊Maven項目,共享一個共同的父POM。其中一些模塊將使用Spring Boot,但有些模塊不會。我不想使用Spring Boot作爲我的父pom的父項,並且在不使用它們的模塊中具有不必要的依賴項。不使用Spring Boot作爲父pom的後果是什麼?

不使用Spring Boot父pom有什麼後果?所有的自動配置好的東西都可以工作嗎?我正在考慮把這個在我父POM作爲替代

<dependencyManagement> 
    <dependencies> 
     <dependency> 
      <!-- Import dependency management from Spring Boot --> 
       <groupId>org.springframework.boot</groupId> 
       <artifactId>spring-boot-dependencies</artifactId> 
       <version>1.4.1.RELEASE</version> 
       <type>pom</type> 
       <scope>import</scope> 
      </dependency> 
     </dependencies> 
</dependencyManagement> 

以下解決方案,但我很新的這一切Maven的東西,春天啓動,所以我不希望任何意想不到的後果或declaw能力任何方式的Spring Boot。如果我這樣做,有人可以解釋我會失去什麼(如果有的話)?謝謝!

回答

2

0123'解釋瞭如何在沒有spring-boot-starter-parent的情況下使用Spring Boot,以及會發生什麼情況。 This answer也解釋了spring-boot-starter-parentspring-boot-dependencies之間的差異。簡介:通過這兩種方式,您可以獲得所有Spring Boot組件和第三方庫的強大依賴關係管理。 spring-boot-starter-parent還配置了一些Maven插件,如spring-boot-maven-plugin,用於運行mvn spring-boot:run

相關問題