1
- buildscript {
2
- ext {
3
- springBootVersion = ' 2.1.3.RELEASE'
4
- }
5
- repositories {
6
- mavenCentral()
7
- }
8
- dependencies {
9
- classpath(" org.springframework.boot:spring-boot-gradle-plugin:${ springBootVersion} " )
10
- }
11
- }
12
-
13
1
plugins {
14
- id ' com.google.cloud.tools.jib' version ' 0.9.11'
2
+ id ' org.springframework.boot' version ' 2.1.3.RELEASE'
3
+ id ' org.jetbrains.kotlin.jvm' version ' 1.2.71'
4
+ id ' org.jetbrains.kotlin.plugin.spring' version ' 1.2.71'
5
+ id ' com.google.cloud.tools.jib' version ' 1.0.2'
15
6
}
16
7
17
- apply plugin : ' java'
18
- apply plugin : ' eclipse'
19
- apply plugin : ' org.springframework.boot'
20
8
apply plugin : ' io.spring.dependency-management'
21
9
22
- sourceCompatibility = 1.8
23
- targetCompatibility = 1.8
10
+ group = ' com.example'
11
+ version = ' 0.0.1-SNAPSHOT'
12
+ sourceCompatibility = ' 1.8'
24
13
25
14
repositories {
26
15
mavenCentral()
27
16
}
28
17
29
18
dependencies {
30
- compile(' org.springframework.boot:spring-boot-starter-web' )
31
- testCompile(' org.springframework.boot:spring-boot-starter-test' )
19
+ implementation ' org.springframework.boot:spring-boot-starter-web'
20
+ implementation ' com.fasterxml.jackson.module:jackson-module-kotlin'
21
+ implementation ' org.jetbrains.kotlin:kotlin-reflect'
22
+ implementation ' org.jetbrains.kotlin:kotlin-stdlib-jdk8'
23
+
24
+ testImplementation ' org.springframework.boot:spring-boot-starter-test'
25
+ }
26
+
27
+ compileKotlin {
28
+ kotlinOptions {
29
+ freeCompilerArgs = [' -Xjsr305=strict' ]
30
+ jvmTarget = ' 1.8'
31
+ }
32
+ }
33
+
34
+ compileTestKotlin {
35
+ kotlinOptions {
36
+ freeCompilerArgs = [' -Xjsr305=strict' ]
37
+ jvmTarget = ' 1.8'
38
+ }
32
39
}
33
40
34
41
jib {
@@ -38,14 +45,14 @@ jib {
38
45
to {
39
46
image = ' registry.hub.docker.com/heowc1992/my-app'
40
47
auth {
41
- username = dockerUsername
42
- password = dockerPassword
48
+ username = dockerUsername
49
+ password = dockerPassword
43
50
}
44
51
}
45
52
container {
46
53
jvmFlags = [' -Djava.security.egd=file:/dev/./urandom' , ' -Duser.timezone=GMT+09' ]
47
- mainClass = ' com.heowc.Application '
48
- // args = ['some args']
54
+ mainClass = ' com.example.java.SpringBootDockerApplication '
55
+ // mainClass = 'com.example.kotlin.SpringBootDockerApplicationKt'
49
56
ports = [' 8080' ]
50
57
}
51
- }
58
+ }
0 commit comments