-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
97 lines (84 loc) · 2.4 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
buildscript {
ext {
springBootVersion = '2.0.4.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath('se.transmode.gradle:gradle-docker:1.2')
classpath "io.spring.gradle:dependency-management-plugin:1.0.0.RC2"
}
}
apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'docker'
apply plugin: 'io.spring.dependency-management'
group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8
targetCompatibility = 1.8
//jar {
// baseName = 'sirano-api'
// version = '0.0.1'
//}
//
//task print() {
// doLast {
// println "github push complete"
// }
//}
//
//task buildDocker(type: Docker, dependsOn: build) {
// push = true
// applicationName = jar.baseName
// dockerfile = file('src/main/docker/Dockerfile')
// doFirst {
// copy {
// from jar
// into stageDir
// }
// }
//}
task buildDocker(type: Docker, dependsOn: build) {
push = false
applicationName = rootProject.name
dockerfile = file('src/main/docker/Dockerfile')
doFirst {
// Rename the app jar to "app.jar" so that the Dockerfile does not require renames
copy {
from "${project.buildDir}/libs"
into stageDir
include "${rootProject.name}-${version}.jar"
rename("${rootProject.name}-${version}.jar", "app.jar")
}
}
doLast {
println "Run the Docker Container"
println "docker run -ti -p 8081:8081 $project.group/$applicationName:$version"
}
}
repositories {
mavenCentral()
}
dependencies {
compile('org.springframework.boot:spring-boot-starter')
testCompile('org.springframework.boot:spring-boot-starter-test')
compile group: 'org.elasticsearch', name: 'elasticsearch', version: '6.4.0'
compile 'org.elasticsearch.client:elasticsearch-rest-high-level-client:6.4.0'
compile group: 'com.google.code.gson', name: 'gson', version: '2.7'
// compile('org.springframework.boot:spring-boot-starter-data-elasticsearch')
// compile('org.elasticsearch.client:elasticsearch-rest-client-sniffer:6.4.0')
compile "org.springframework.boot:spring-boot-starter-web"
compile group: 'com.google.guava', name: 'guava', version: '22.0'
compileOnly('org.projectlombok:lombok')
compile group: 'cglib', name: 'cglib-nodep', version: '2.2'
testCompile(
'junit:junit:4.12',
'org.codehaus.groovy:groovy-all:2.4.4',
'org.spockframework:spock-core:1.0-groovy-2.4'
)
}