-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathbuild.gradle
More file actions
50 lines (44 loc) · 1.03 KB
/
build.gradle
File metadata and controls
50 lines (44 loc) · 1.03 KB
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
buildscript {
ext {
if (JavaVersion.current() >= JavaVersion.VERSION_17) {
SPRING_BOOT_VERSION = '3.4.1'
javaCompatibility = JavaVersion.VERSION_17
} else {
SPRING_BOOT_VERSION = '2.7.18'
javaCompatibility = JavaVersion.VERSION_1_8
}
}
}
plugins {
id 'java'
id 'org.springframework.boot' version "${SPRING_BOOT_VERSION}"
id 'io.spring.dependency-management' version '1.1.7'
}
repositories {
mavenCentral()
}
java {
sourceCompatibility = javaCompatibility
targetCompatibility = javaCompatibility
}
sourceSets {
main {
java {
srcDirs = ['src/main/java']
}
}
}
dependencies {
implementation 'org.apache.httpcomponents:httpclient:4.5.14'
implementation 'org.springframework.boot:spring-boot-starter'
}
bootJar {
// I don't understand why hasProperty doesn't work here, but properties.containsKey does....
// if (hasProperty("mainClass")) {
if (properties.containsKey("mainClass")) {
mainClass = 'com.example.App'
}
else {
mainClassName = 'com.example.App'
}
}