67 lines
2.3 KiB
Groovy
67 lines
2.3 KiB
Groovy
buildscript {
|
|
ext {
|
|
springBootVersion = '2.1.4.RELEASE'
|
|
}
|
|
repositories {
|
|
maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'}
|
|
}
|
|
dependencies {
|
|
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
|
|
}
|
|
}
|
|
// 全局配置
|
|
allprojects {
|
|
group 'com.diboot'
|
|
version '2.0-alpha'
|
|
apply plugin: 'idea'
|
|
}
|
|
// 子项目的配置
|
|
subprojects {
|
|
apply plugin: 'java'
|
|
|
|
sourceCompatibility = 1.8
|
|
targetCompatibility = 1.8
|
|
|
|
[compileJava,compileTestJava,javadoc]*.options*.encoding = 'UTF-8'
|
|
repositories {
|
|
maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'}
|
|
}
|
|
ext {//依赖版本
|
|
springBootVersion = "2.1.4.RELEASE"
|
|
mysqlConnectorVersion = "8.0.16"
|
|
mybatisStarterVersion = "2.0.1"
|
|
mybatisPlusVersion = "3.1.1"
|
|
fastjsonVersion = "1.2.58"
|
|
lombokVersion = "1.18.8"
|
|
}
|
|
dependencies {
|
|
//gradle 4.7版本以上,使用如下方式
|
|
// annotationProcessor("org.projectlombok:lombok:$lombokVersion")
|
|
// compileOnly("org.projectlombok:lombok:$lombokVersion")
|
|
//gradle 4.7版本以下,使用如下方式
|
|
compileOnly("org.projectlombok:lombok:$lombokVersion")
|
|
|
|
compile("javax.servlet:javax.servlet-api:4.0.1")
|
|
compile("org.springframework.boot:spring-boot-starter-web:$springBootVersion")
|
|
// Mybatis
|
|
compile("org.mybatis.spring.boot:mybatis-spring-boot-starter:$mybatisStarterVersion")
|
|
// Mybatis-Plus
|
|
compile("com.baomidou:mybatis-plus-boot-starter:$mybatisPlusVersion")
|
|
// Log4j2
|
|
compile("org.springframework.boot:spring-boot-starter-log4j2:$springBootVersion")
|
|
// JDBC Driver
|
|
compile("mysql:mysql-connector-java:$mysqlConnectorVersion")
|
|
// JSON
|
|
compile("com.alibaba:fastjson:$fastjsonVersion")
|
|
// Apache Commons
|
|
compile("org.apache.commons:commons-lang3:3.8.1")
|
|
|
|
// 单元测试
|
|
testCompile("org.springframework.boot:spring-boot-starter-test:$springBootVersion")
|
|
testCompile("junit:junit:4.12")
|
|
}
|
|
configurations {
|
|
//移除spring boot 默认logger依赖
|
|
all*.exclude module: 'spring-boot-starter-logging'
|
|
}
|
|
} |