/
build.gradle
100 lines (81 loc) · 2.17 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
buildscript {
ext {
springBootVersion = "1.3.8.RELEASE"
}
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion")
}
}
plugins {
id "war"
id "java"
id "idea"
id "eclipse"
id "cn.bestwu.propdeps" version "0.0.10"
id "cn.bestwu.propdeps-idea" version "0.0.10"
id "cn.bestwu.propdeps-maven" version "0.0.10"
id "cn.bestwu.propdeps-eclipse" version "0.0.10"
//id "com.avast.gradle.docker-compose" version "0.6.13" // java 1.8 runtime required
}
apply plugin: "spring-boot"
version = "1.0.1"
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_7
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
compile "org.springframework.boot:spring-boot-starter-web",
"org.springframework.boot:spring-boot-starter-data-jpa",
"com.h2database:h2"
testCompile "org.springframework.boot:spring-boot-starter-test"
providedRuntime "org.springframework.boot:spring-boot-starter-tomcat"
providedCompile "javax:javaee-api:7.0"
//providedCompile "javax.inject:javax.inject:1"
//runtime "javax:javaee-api:7.0"
optional "org.springframework.boot:spring-boot-configuration-processor"
}
defaultTasks "clean", "build"
compileJava.dependsOn(processResources)
processResources {
expand(project.properties)
}
// ./gradlew -PspringBoot.executable=true
def buildBashScript = project.hasProperty("springBoot.executable") && project.getProperty("springBoot.executable")
springBoot {
executable = buildBashScript
}
task wrapper(type: Wrapper) {
gradleVersion = "2.9"
}
idea {
module {
downloadSources = true
}
}
eclipse {
classpath {
downloadSources = true
}
}
/*
def profile = project.hasProperty("profile") ? "-${project.getProperty("profile")}" : ""
dockerCompose {
useComposeFiles = [project.file("docker-compose${profile}.yaml")]
// captureContainersOutput = true
captureContainersOutput = false
stopContainers = true
removeContainers = true
removeImages = "Local"
removeVolumes = true
removeOrphans = true
forceRecreate = true
waitForTcpPorts = false
projectName = project.name
}
composeUp.dependsOn assemble
*/