-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
93 lines (76 loc) · 3.2 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
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Gradle plugin project to get you started.
* For more details take a look at the Writing Custom Plugins chapter in the Gradle
* User Manual available at https://docs.gradle.org/6.5.1/userguide/custom_plugins.html
*/
import com.github.jengelman.gradle.plugins.shadow.transformers.*
plugins {
// Apply the java plugin to add support for Java
id 'java'
id 'idea'
// Apply the application plugin to add support for building a CLI application.
id 'application'
id 'java-gradle-plugin'
// springboot
id 'org.springframework.boot' version '2.3.1.RELEASE'
// shadowJar
id 'com.github.johnrengelman.shadow' version '5.2.0'
}
version = '1.0.1'
mainClassName = 'flink.App'
description = """Flink Job"""
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
applicationDefaultJvmArgs = ["-Dlog4j.configurationFile=log4j.properties"]
repositories {
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
}
// NOTE: We cannot use "compileOnly" or "shadow" configurations since then we could not run code
// in the IDE or with "gradle run". We also cannot exclude transitive dependencies from the
// shadowJar yet (see https://github.com/johnrengelman/shadow/issues/159).
// -> Explicitly define the // libraries we want to be included in the "flinkShadowJar" configuration!
configurations {
all*.exclude group: "org.springframework.boot", module: "spring-boot-starter-logging"
all*.exclude group: "ch.qos.logback"
all*.exclude group: "org.slf4j", module: "log4j-over-slf4j" // allow using log4j 2.x
all*.exclude group: "org.slf4j", module: "slf4j-simple" // log4j is the configured backend
}
dependencies {
// spring boot starter deps
implementation 'org.springframework.boot:spring-boot-starter:2.3.1.RELEASE'
// flink
implementation 'org.apache.flink:flink-streaming-java_2.12:1.11.0'
// Aliyun
implementation 'com.aliyun.openservices:ons-client:1.8.4.Final'
implementation 'com.aliyun.openservices:tablestore:5.4.0:jar-with-dependencies'
// lombok
compileOnly 'org.projectlombok:lombok:1.18.12'
annotationProcessor 'org.projectlombok:lombok:1.18.12'
// log
implementation "org.apache.logging.log4j:log4j-api:2.12.1"
implementation "org.apache.logging.log4j:log4j-core:2.12.1"
implementation "org.apache.logging.log4j:log4j-slf4j-impl:2.12.1"
implementation "org.slf4j:slf4j-log4j12:1.7.15"
}
shadowJar {
zip64 true
// Required for Spring
mergeServiceFiles()
transform(AppendingTransformer) { resource = 'reference.conf' }
transform(AppendingTransformer) { resource = 'META-INF/spring.handlers' }
transform(AppendingTransformer) { resource = 'META-INF/spring.schemas' }
transform(AppendingTransformer) { resource = 'META-INF/spring.tooling' }
transform(PropertiesFileTransformer) {
paths = ['META-INF/spring.factories' ]
mergeStrategy = "append"
}
manifest {
attributes 'Main-Class': "${mainClassName}"
}
}