springboot常用设置
1.pom.xml
4.0.0
org.springframework.boot
spring-boot-starter-parent
2.5.6
com.xxx
implents
0.0.1-SNAPSHOT
implents
Demo project for Spring Boot
1.8
true
org.springframework.boot
spring-boot-starter
org.projectlombok
lombok
true
org.springframework.boot
spring-boot-starter-test
test
io.springfox
springfox-swagger2
2.9.2
io.springfox
springfox-swagger-ui
2.9.2
org.springframework.boot
spring-boot-starter-web
org.springframework.boot
spring-boot-starter-logging
org.springframework.boot
spring-boot-starter-log4j2
org.jsoup
jsoup
RELEASE
com.alibaba
fastjson
RELEASE
org.apache.commons
commons-lang3
3.3.2
org.seleniumhq.selenium
selenium-java
org.mybatis.spring.boot
mybatis-spring-boot-starter
2.1.3
mysql
mysql-connector-java
org.springframework.boot
spring-boot-starter-test
test
junit
junit
com.github.pagehelper
pagehelper-spring-boot-starter
1.3.0
org.springframework.boot
spring-boot-starter-thymeleaf
zy
org.springframework.boot
spring-boot-maven-plugin
org.projectlombok
lombok
2.log4j2.xml
demo
logs
30 MB
3.application.yml
spring:
datasource: #修改数据库连接配置
url: jdbc:mysql://localhost/ziyuan?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
driver-class-name: com.mysql.cj.jdbc.Driver
username: 123456
password: 123456
web:
resources:
static-locations: classpath:/static,classpath:/public,classpath:/resources,classpath:/meta-INF/resources,classpath:/static/img
# mybatis配置
mybatis:
type-aliases-package: com.xxx.implents.domain # 别名目录
# pagehelper
pagehelper:
helperDialect: mysql
reasonable: true
supportMethodsArguments: true
params: count=countSql
server:
port: 8082
4.测试
import org.junit.Test;
import org.junit.runner.RunWith;
@SpringBootTest
@RunWith(SpringJUnit4ClassRunner.class)
public class BaiDuSearchControllerTest {
@Autowired
BaiDuSearchController baiDuSearchController;
@Test
public void test(){
//测试代码
}
}