這篇文章將為大家詳細(xì)講解有關(guān)SpringBoot+SpringSecurity環(huán)境怎么搭建,小編覺(jué)得挺實(shí)用的,因此分享給大家做個(gè)參考,希望大家閱讀完這篇文章后可以有所收獲。
創(chuàng)新互聯(lián)是專(zhuān)業(yè)的汝陽(yáng)網(wǎng)站建設(shè)公司,汝陽(yáng)接單;提供成都網(wǎng)站設(shè)計(jì)、做網(wǎng)站,網(wǎng)頁(yè)設(shè)計(jì),網(wǎng)站設(shè)計(jì),建網(wǎng)站,PHP網(wǎng)站建設(shè)等專(zhuān)業(yè)做網(wǎng)站服務(wù);采用PHP框架,可快速的進(jìn)行汝陽(yáng)網(wǎng)站開(kāi)發(fā)網(wǎng)頁(yè)制作和功能擴(kuò)展;專(zhuān)業(yè)做搜索引擎喜愛(ài)的網(wǎng)站,專(zhuān)業(yè)的做網(wǎng)站團(tuán)隊(duì),希望更多企業(yè)前來(lái)合作!
一、使用SpringBoot+Maven搭建一個(gè)多模塊項(xiàng)目
二、刪除父工程的src文件,刪除app、browser、core下的.java文件
依賴關(guān)系:
demo 依賴 browser
browser、app依賴core
三、父工程pom.xml文件
4.0.0 com.zeke zeke-security 0.0.1-SNAPSHOT pom zeke-security 1.0-SNAPSHOT zeke-security-app zeke-security-browser zeke-security-core zeke-security-demo junit junit test org.springframework.boot spring-boot-test 1.5.8.RELEASE test io.spring.platform platform-bom Brussels-SR6 pom import org.springframework.cloud spring-cloud-dependencies Dalston.SR5 pom import org.springframework.boot spring-boot-configuration-processor true org.apache.maven.plugins maven-compiler-plugin 2.3.2 1.8 UTF-8
四、zeke-security-demo項(xiàng)目下的pom.xml文件
4.0.0 com.zeke zeke-security 0.0.1-SNAPSHOT zeke-security-demo >com.zeke zeke-security-browser ${zeke-security-version} junit junit 4.12-beta-3 test org.springframework.boot spring-boot-starter-aop commons-io commons-io io.springfox springfox-swagger2 2.7.0 io.springfox springfox-swagger-ui 2.7.0 com.github.tomakehurst wiremock 2.14.0 org.springframework spring-test 4.3.12.RELEASE test org.springframework spring-test 4.3.12.RELEASE test org.springframework spring-test 4.3.12.RELEASE test org.springframework.boot spring-boot-maven-plugin 1.5.6.RELEASE repackage demo
五、zeke-security-core項(xiàng)目下的pom.xml文件
4.0.0 zeke-security com.zeke 0.0.1-SNAPSHOT zeke-security-core org.springframework.cloud spring-cloud-starter-oauth3 org.springframework.boot spring-boot-starter-jdbc MySQL mysql-connector-java org.springframework.social spring-social-config org.springframework.social spring-social-core org.springframework.social spring-social-security org.springframework.social spring-social-web commons-lang commons-lang commons-collections commons-collections commons-beanutils commons-beanutils
六、zeke-security-browser項(xiàng)目下的pom.xml文件
4.0.0 com.zeke zeke-security 0.0.1-SNAPSHOT zeke-security-browser com.zeke zeke-security-core ${zeke-security-version} org.springframework.session spring-session
七、zeke-security-app項(xiàng)目下的pom.xml文件
4.0.0 zeke-security com.zeke 0.0.1-SNAPSHOT zeke-security-app com.zeke zeke-security-core ${zeke-security-version}
八、zeke-security-demo項(xiàng)目下的application.properties
spring.datasource.driver-class-name=com.mysql.jdbc.Driver spring.datasource.url=jdbc:mysql://127.0.0.1:3306/imooc-demo spring.datasource.username=root spring.datasource.password= spring.session.store-type=none security.basic.enabled=false
九、在zeke-security-demo啟動(dòng)類(lèi)上添加測(cè)試接口
@RestController @SpringBootApplication public class ZekeSecurityDemoApplication { public static void main(String[] args) { SpringApplication.run(ZekeSecurityDemoApplication.class, args); } @GetMapping("/hello") public String hello(){ return "success"; } }
十、輸入地址localhost/hello
關(guān)于“SpringBoot+SpringSecurity環(huán)境怎么搭建”這篇文章就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,使各位可以學(xué)到更多知識(shí),如果覺(jué)得文章不錯(cuò),請(qǐng)把它分享出去讓更多的人看到。