|
@@ -5,6 +5,7 @@ apply from: 'dependencyDefine.gradle'
|
|
|
buildscript {
|
|
|
ext {
|
|
|
springBootVersion = '2.1.3.RELEASE'
|
|
|
+// wrapperVersion = '1.0.21.RELEASE'
|
|
|
}
|
|
|
repositories {
|
|
|
mavenLocal()
|
|
@@ -15,6 +16,7 @@ buildscript {
|
|
|
}
|
|
|
}
|
|
|
dependencies {
|
|
|
+// classpath("org.springframework.boot.experimental:spring-boot-thin-gradle-plugin:${wrapperVersion}")
|
|
|
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
|
|
|
}
|
|
|
}
|
|
@@ -22,6 +24,7 @@ buildscript {
|
|
|
subprojects {
|
|
|
apply plugin: 'java'
|
|
|
apply plugin: "idea"
|
|
|
+ apply plugin: 'maven'
|
|
|
// apply plugin: 'eclipse'
|
|
|
apply plugin: 'org.springframework.boot'
|
|
|
apply plugin: 'io.spring.dependency-management'
|
|
@@ -41,29 +44,54 @@ subprojects {
|
|
|
maven { url = "http://maven.aliyun.com/nexus/content/groups/public" }
|
|
|
mavenCentral()
|
|
|
}
|
|
|
+
|
|
|
+ configurations{
|
|
|
+ parentClasspath {}
|
|
|
+ }
|
|
|
+
|
|
|
+// 清除现有的lib目录
|
|
|
+ task clearJar(type: Delete) {
|
|
|
+ delete "$buildDir/libs/lib"
|
|
|
+ }
|
|
|
+
|
|
|
+// 将依赖包复制到lib目录
|
|
|
+ task copyJar(type: Copy, dependsOn: 'clearJar') {
|
|
|
+ from configurations.compileClasspath
|
|
|
+ into "$buildDir/libs/lib"
|
|
|
+ }
|
|
|
+
|
|
|
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')
|
|
|
+ compileClasspath("org.springframework.boot:spring-boot-starter")
|
|
|
+ compileClasspath("org.springframework.boot:spring-boot-starter-web")
|
|
|
+ compileClasspath('org.springframework.boot:spring-boot-starter-aop')
|
|
|
+ compileClasspath('org.springframework.boot:spring-boot-starter-jdbc')
|
|
|
+ compileClasspath('org.springframework.boot:spring-boot-starter-data-jpa')
|
|
|
+// compileClasspath("org.springframework.boot:spring-boot-starter-security")
|
|
|
+ compileClasspath("org.springframework.boot:spring-boot-starter-actuator")
|
|
|
+ compileClasspath('org.springframework.boot:spring-boot-starter-logging')
|
|
|
+ compileClasspath('org.springframework.boot:spring-boot-starter-cache')
|
|
|
+ compileClasspath('org.springframework.boot:spring-boot-starter-data-redis')
|
|
|
+ compileClasspath("org.springframework.boot:spring-boot-devtools")
|
|
|
+
|
|
|
+ compileClasspath('mysql:mysql-connector-java')
|
|
|
+ compileClasspath(libraries."mybatis", libraries."mybatis-page")
|
|
|
+ compileClasspath("tk.mybatis:mapper-spring-boot-starter:2.1.5"){
|
|
|
+ exclude group: "javax.persistence"
|
|
|
+ }
|
|
|
|
|
|
testCompile("org.springframework.boot:spring-boot-starter-test")
|
|
|
|
|
|
- compile fileTree(dir:'libs',include:['*.jar'])
|
|
|
- }
|
|
|
|
|
|
+ compileClasspath group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.9.9'
|
|
|
+ compileClasspath group: 'com.alibaba', name: 'fastjson', version: '1.2.46'
|
|
|
+ compileClasspath 'javax.persistence:javax.persistence-api:2.2'
|
|
|
+
|
|
|
+ compileClasspath fileTree(dir:'libs',include:['*.jar'])
|
|
|
+ }
|
|
|
|
|
|
//自定义环境 start
|
|
|
- def env = System.getProperty("env") ?: "dev"
|
|
|
+ def env = System.getProperty("ENV") ?: (System.getenv("ENV") ?: "dev")
|
|
|
+ println(env)
|
|
|
sourceSets {
|
|
|
main {
|
|
|
resources {
|
|
@@ -85,6 +113,8 @@ subprojects {
|
|
|
configure(subprojects.findAll {it.name.contains('api')}) {
|
|
|
apply plugin: 'war'
|
|
|
apply plugin: 'application'
|
|
|
+// apply plugin: 'org.springframework.boot.experimental.thin-launcher'
|
|
|
+
|
|
|
springBoot {
|
|
|
buildInfo()
|
|
|
}
|
|
@@ -95,10 +125,26 @@ configure(subprojects.findAll {it.name.contains('api')}) {
|
|
|
// }
|
|
|
// }
|
|
|
|
|
|
+// task createPom {
|
|
|
+// doLast {
|
|
|
+// pom {
|
|
|
+// withXml(dependencyManagement.pomConfigurer)
|
|
|
+// }.writeTo("build/resources/main/META-INF/maven/${project.group}/${project.name}/pom.xml")
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// thinResolvePrepare {
|
|
|
+// into new File("${buildDir}/thin/deploy")
|
|
|
+// }
|
|
|
+//
|
|
|
+// jar.dependsOn = [createPom]
|
|
|
+
|
|
|
+
|
|
|
dependencies {
|
|
|
// providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat'
|
|
|
- providedRuntime 'org.springframework.boot:spring-boot-starter-jetty'
|
|
|
+// providedRuntime 'org.springframework.boot:spring-boot-starter-jetty'
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
project(':data') {
|
|
@@ -110,5 +156,7 @@ project(':gateway-api') {
|
|
|
dependencies {
|
|
|
compile(project(":tools"))
|
|
|
compile(project(":data"))
|
|
|
+ compileClasspath project(path:":tools", configuration: 'parentClasspath')
|
|
|
+ compileClasspath project(path:":data", configuration: 'parentClasspath')
|
|
|
}
|
|
|
-}
|
|
|
+}
|