-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
102 lines (87 loc) · 3.06 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
buildscript {
ext{
mysqlVersion = '8.0.15'
}
}
plugins {
id 'org.springframework.boot' version '2.3.2.RELEASE'
id 'io.spring.dependency-management' version '1.0.9.RELEASE'
id 'java'
id 'org.jbooster.mybatis.generator' version '0.1.3'
id "org.flywaydb.flyway" version "6.5.2"
}
group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter:2.1.3'
implementation 'com.gitee.sunchenbin.mybatis.actable:mybatis-enhance-actable:1.2.1.RELEASE'
implementation 'org.mybatis.generator:mybatis-generator:1.3.7'
implementation 'org.mybatis.generator:mybatis-generator-core:1.3.7'
runtimeOnly 'mysql:mysql-connector-java:8.0.15'
implementation 'com.alibaba:druid-spring-boot-starter:1.1.17'
implementation 'io.springfox:springfox-swagger2:2.9.2'
implementation 'io.springfox:springfox-swagger-ui:2.9.2'
implementation 'com.github.pagehelper:pagehelper-spring-boot-starter:1.3.0'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
testImplementation 'junit:junit:4.12'
}
test {
useJUnitPlatform()
}
flyway {
url = 'jdbc:mysql://localhost:3306/flywaydemo'
user = 'root'
password = 'root'
//数据库中要迁移的schema,此处使用默认的
//schemas = ['schema1', 'schema2', 'schema3']
//在flyway脚本中,可以使用占位符来书写SQL语句,执行时会自动替换
placeholders = [
'keyABC': 'valueXYZ',
'otherplaceholder': 'value123'
]
}
mbg {
// 是否覆盖旧文件,默认为true
overwrite = true
// 是否打印执行过程日志,默认为false
verbose = false
// 是否打印调试日志,默认为false
debug = false
// 数据库连接信息,在xml中的引用方式:${jdbc.属性名}
// 若该信息已在xml文件中写死,则不必在此处配置
jdbc {
// 驱动类,默认为'com.mysql.jdbc.Driver'
driver = 'com.mysql.jdbc.Driver'
// 默认为空
url = 'jdbc:mysql://127.0.0.1:3306/mybatis?useSSL=false'
// 默认为root
username = 'root'
// 默认为空
password = 'root'
}
// 配置文件路径(默认包含generatorConfig.xml)及上下文,支持多配置文件
// key:配置文件路径(在src/main/resources下的相对路径)
// value:上下文
config['gradle-generator.xml'] = {
// 待生成的文件路径信息,在xml中的引用方式:${file.属性名}
// 以下皆为默认配置,不建议自定义配置,推荐默认配置
// 若在此处配该信息已在xml文件中写死,则不必设置,使用空闭包即可
// 实体类文件
modelDir = 'gensrc/main/java'
modelPackage = "com.example.mybatisdemo.gradle.model"
// *Mapper.xml文件
xmlDir = 'src/main/resources'
xmlPackage = 'gradle.mapper'
// *Mapper.java文件
clientDir = 'src/main/java'
clientPackage = "com.example.mybatisdemo.gradle.mapper"
}
}