123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- apply from: 'dependencyDefine.gradle'
- // SpringBoot
- buildscript {
- ext {
- springBootVersion = '2.1.3.RELEASE'
- }
- repositories {
- mavenLocal()
- // maven { url = "http://maven.aliyun.com/nexus/content/groups/public" }
- mavenCentral()
- maven {
- url "https://plugins.gradle.org/m2/"
- }
- }
- dependencies {
- classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
- }
- }
- subprojects {
- apply plugin: 'java'
- apply plugin: "idea"
- // apply plugin: 'eclipse'
- apply plugin: 'org.springframework.boot'
- apply plugin: 'io.spring.dependency-management'
- group = 'com.qxgmat'
- version = '0.0.1-SNAPSHOT'
- sourceCompatibility = 1.8
- targetCompatibility = 1.8
- tasks.withType(JavaCompile) {
- options.encoding = 'UTF-8'
- }
- repositories {
- mavenLocal()
- maven { url = "http://maven.aliyun.com/nexus/content/groups/public" }
- mavenCentral()
- }
- dependencies {
- compile("org.springframework.boot:spring-boot-starter")
- compile("org.springframework.boot:spring-boot-starter-web")
- compile('org.springframework.boot:spring-boot-starter-aop')
- compile('org.springframework.boot:spring-boot-starter-jdbc')
- compile('org.springframework.boot:spring-boot-starter-data-jpa')
- // compile("org.springframework.boot:spring-boot-starter-security")
- compile("org.springframework.boot:spring-boot-starter-actuator")
- compile('org.springframework.boot:spring-boot-starter-logging')
- compile('org.springframework.boot:spring-boot-starter-cache')
- compile('org.springframework.boot:spring-boot-starter-data-redis')
- compile("org.springframework.boot:spring-boot-devtools")
- compile('mysql:mysql-connector-java')
- testCompile("org.springframework.boot:spring-boot-starter-test")
- compile fileTree(dir:'libs',include:['*.jar'])
- }
- //自定义环境 start
- def env = System.getProperty("env") ?: "dev"
- sourceSets {
- main {
- resources {
- srcDirs = ["src/main/resources", "src/main/profile/$env", "src/main/java"]
- }
- }
- }
- //自定义环境 end
- }
- // 如果不使用spring boot plugin,也可以使用spring boot dependency management,只需要导入SpringBootPlugin类的BOM_COORDINATES常量
- //dependencyManagement {
- // imports {
- // mavenBom org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES
- // }
- //}
- //如果module中名称有包含api的,则加入下面的内容
- configure(subprojects.findAll {it.name.contains('api')}) {
- apply plugin: 'war'
- apply plugin: 'application'
- springBoot {
- buildInfo()
- }
- // war {
- // manifest {
- // attributes("Implementation-Title": "Gradle")
- // }
- // }
- dependencies {
- // providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat'
- providedRuntime 'org.springframework.boot:spring-boot-starter-jetty'
- }
- }
- project(':data') {
- dependencies {
- compile(project(":tools"))
- }
- }
- project(':gateway-api') {
- dependencies {
- compile(project(":tools"))
- compile(project(":data"))
- }
- }
|