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

Required dependencies

Our application has already defined all the necessary dependencies required for this chapter. However, if you are using Spring Security's JDBC support, you are likely going to want the following dependencies listed in your build.gradle file. It is important to highlight that the JDBC driver that you will use will depend on which database you are using. Consult your database vendor's documentation for details on which driver is needed for your database.

Remember that all the Spring versions need to match, and all Spring Security versions need to match (this includes transitive dependency versions). If you are having difficulty getting this to work in your own application, you may want to define the dependency management section in build.gradle to enforce this, as shown in Chapter 2, Getting Started with Spring Security. As previously mentioned, you will not need to worry about this when using the sample code, since we have already set up the necessary dependencies for you.

The following snippet defines the required dependencies needed for this chapter, including Spring Security and JDBC dependencies:

    //build.gradle

dependencies {
...
// Database:
compile('org.springframework.boot:spring-boot-starter-jdbc')
compile('com.h2database:h2')
// Security:
compile('org.springframework.boot:spring-boot-starter-security')
testCompile('org.springframework.security:spring-security-test')
....
}