If you use parent, if you use spring platform platform?

Some versions of the dependencies are not included, so I added the spring platform specification, is the parent declaration still useful?

 <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.2.1.RELEASE</version> </parent> <dependencyManagement> <dependencies> <dependency> <groupId>io.spring.platform</groupId> <artifactId>platform-bom</artifactId> <version>1.1.1.RELEASE</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> 
+2
source share
2 answers

I personally prefer to use platform-bom as a parent, i.e.

 <parent> <groupId>io.spring.platform</groupId> <artifactId>platform-bom</artifactId> <version>1.1.1.RELEASE</version> <relativePath /> </parent> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> </dependencies> 

This way, I don't need to determine the spring-boot version number, and it automatically updates with the new spring platform version, and I don't need to worry about any inconsistencies.

For a complete list of all managed dependencies, see http://docs.spring.io/platform/docs/1.1.1.RELEASE/reference/htmlsingle/#appendix-dependency-versions .

EDIT . As Andy Wilkinson noted, the spring platform inherits spring-boot-starter-parent , so all the "reasonable defaults" as described in http://docs.spring.io/spring-boot/docs/1.2.1.RELEASE/ reference / htmlsingle / # using-boot-maven .

+3
source

There is a significant difference between importing a specification (in the dependencyManagement section) and using parent

The specification imported into dependencyManagement provides only default values ​​for dependencies, but the parent path includes other sections ( plugins , plugin-managent , dependencies , dependencyManagement ...)

Therefore, when you remove the parent spring-boot-starter-parent , you need to copy the plugin-managent material you need.

+2
source

All Articles