forked from jozala/spring-boot-admin-docker
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
86 lines (73 loc) · 2.18 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
buildscript {
ext {
springBootVersion = '1.5.9.RELEASE'
gradleDockerVersion = "1.2"
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath("se.transmode.gradle:gradle-docker:${gradleDockerVersion}")
}
}
apply plugin: 'java'
apply plugin: 'org.springframework.boot'
apply plugin: 'docker'
version = '1.5.5'
jar {
baseName = 'spring-boot-admin-ui'
version = project.version
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
}
dependencyManagement {
imports {
mavenBom 'org.springframework.cloud:spring-cloud-dependencies:Dalston.SR3'
}
}
dependencies {
compile "org.springframework.boot:spring-boot-starter"
compile "org.springframework.boot:spring-boot-starter-security"
compile "de.codecentric:spring-boot-admin-starter-client:${version}"
compile "de.codecentric:spring-boot-admin-server:${version}"
compile "de.codecentric:spring-boot-admin-server-ui:${version}"
compile "de.codecentric:spring-boot-admin-server-ui-login:${version}"
testCompile "org.springframework.boot:spring-boot-starter-test"
}
task wrapper(type: Wrapper) {
gradleVersion = '4.2.1'
distributionType = "ALL"
}
allprojects {
apply plugin: 'idea'
idea {
module {
outputDir file('build/classes/main')
testOutputDir file('build/classes/test')
}
}
if(project.convention.findPlugin(JavaPluginConvention)) {
// Change the output directory for the main and test source sets back to the old path
sourceSets.main.output.classesDir = new File(buildDir, "classes/main")
sourceSets.test.output.classesDir = new File(buildDir, "classes/test")
}
}
task buildDocker(type: Docker) {
baseImage = 'java:8-jre-alpine'
project.group = "gelder"
applicationName = "spring-boot-admin-ui"
maintainer = "Martin Geldmacher"
entryPoint(['java',
'-jar',
'/app.jar'])
exposePort(8080) // UI
addFile {
from jar
rename {'app.jar'}
}
}
buildDocker.dependsOn(build)