基础环境
JDK:1.8
IDE:IDEA
MySQL、Redis
项目关系
imooc-security:总项目,pom,用于集中管理
core:核心代码
app:手机端相关代码
browser:浏览器端相关代码
demo:演示代码
关于io项目
<dependencyManagement>
<dependencies>
<!--用于统一管理Spring包的依赖-->
<dependency>
<groupId>io.spring.platform</groupId>
<artifactId>platform-bom</artifactId>
<version>Brussels-SR4</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!--Spring Cloud的一个包管理依赖-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Dalston.SR2</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
其实目前官方已经停止这个项目了,但为了学习的时候保持环境一致,还是使用教程中的版本
关于MySQL8
如果使用的是MySQL8,默认情况下使用MySQL5的驱动是无法注册上去的,因为认证方式不同
我这边的方案是将驱动版本改成了8
关闭Security
因为程序中有SpringSecurity的包,其会自动启动权限控制
我们先关闭
security:
basic:
enabled: false
在SpringBoot2.*+Spring 5
中,SpringSecurity的认证关闭已经不再是这种方式了
打出可执行jar
<build>
<plugins>
<!--执行打包的插件-->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>1.3.3.RELEASE</version>
<executions>
<execution>
<goals>
<!--按照Spring Boot特有方式打包,可直接运行-->
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<finalName>demo</finalName>
</build>