Spring Security(Third Edition)
上QQ阅读APP看书,第一时间看更新

Using Spring 4.3 and Spring Security 4.2

Spring 4.2 is used consistently. Our sample applications provide an example of the former option, which means that no additional work is required by you.

In the following code, we present an example fragment of what is added to the Gradle build.gradle file to utilize the dependency management feature of Gradle; this ensures that correct Spring version is used throughout the entire application. We are going to leverage the Spring IO bill of materials (BOM) dependency, which will ensure that all the dependency versions imported by the BOM will work together correctly:

    build.gradle
// Spring Security IO with ensures correct Springframework versions
dependencyManagement {
imports {
mavenBom 'io.spring.platform:platform-bom:Brussels-${springIoVersion}'
}
}
dependencies {
...
}

If you are using Spring Tool Suite, any time you update the build.gradle file, ensure you right-click on the project and navigate to Gradle | Refresh Gradle Project… and select OK to update all the dependencies.

For more information about how Gradle handles transitive dependencies, as well as the BOM, refer to the Gradle documentation, which is listed in the Supplementary materials section, in Appendix, Additional Reference Material