Updating your dependencies
The first step is to update the project's dependencies to include the necessary Spring Security JAR files. Update the Gradle build.gradle file (from the sample application you imported previously) to include the Spring Security JAR files that we will use in the following few sections.
Throughout the book, we will be demonstrating how to provide the required dependencies using Gradle. The build.gradle file is located in the root of the project and represents all that is needed to build the project (including the project's dependencies). Remember that Gradle will download the transitive dependencies for each listed dependency. So, if you are using another mechanism to manage dependencies, ensure that you also include the transitive dependencies. When managing the dependencies manually, it is useful to know that the Spring Security reference includes a list of its transitive dependencies. A link to the Spring Security reference can be found in the Supplementary Materials section in the Supplementary materials section in the Appendix, Additional Reference Material.
Let's take a look at the following code snippet:
build.gradle:
dependencies {
compile "org.springframework.security:spring-security-
config:${springSecurityVersion}"
compile "org.springframework.security:spring-security-
core:${springSecurityVersion}"
compile "org.springframework.security:spring-security-
web:${springSecurityVersion}"
...
}