-
Notifications
You must be signed in to change notification settings - Fork 10
/
build.gradle
174 lines (152 loc) · 5.7 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
id 'com.github.johnrengelman.shadow' version '6.1.0' apply false
id "com.diffplug.spotless" version "5.8.2" apply false
id "io.freefair.lombok" version "5.3.0" apply false
}
ext {
javaVersion = '11'
// flinkGroup = 'com.ververica.flink'
// flinkVersion = '1.12.2-stream1'
flinkGroup = 'org.apache.flink'
flinkVersion = '1.19.0'
scalaBinaryVersion = '2.12'
githubApiVersion = '1.301'
okHttpVersion = '4.9.3'
elasticVersion = '3.0.1-1.17'
kafkaVersion = '3.0.2-1.18'
/*
Mime4J versions 0.8.5+ are built with Java 11 and will fail with the
following error when run on Java 8:
java.lang.NoSuchMethodError: java.nio.CharBuffer.flip()Ljava/nio/CharBuffer;
at org.apache.james.mime4j.mboxiterator.MboxIterator.decodeNextCharBuffer(MboxIterator.java:111)
*/
mime4jVersion = '0.8.4'
log4jVersion = '2.17.1'
junitVersion = '4.13.2'
}
allprojects {
group = 'com.ververica.platform'
version = "2.5.2_${flinkVersion}"
description = """Ververica Platform Lab - Flink Repository Analytics"""
}
subprojects {
apply plugin: 'java'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'com.diffplug.spotless'
apply plugin: 'io.freefair.lombok'
apply plugin: 'maven-publish'
apply plugin: 'eclipse'
// artifact properties
archivesBaseName = "${rootProject.name}-${project.name}"
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
// declare where to find the dependencies of your project
repositories {
// for access from China, you may need to uncomment this line
// maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
mavenCentral()
maven {
url "https://repository.apache.org/content/repositories/snapshots/"
mavenContent {
snapshotsOnly()
}
}
maven {
url 'https://maven.ververica.com/artifactory/vvp-flink-release/'
mavenContent {
releasesOnly()
}
}
}
// common set of dependencies
dependencies {
shadow "org.apache.logging.log4j:log4j-slf4j-impl:${log4jVersion}"
shadow "org.apache.logging.log4j:log4j-api:${log4jVersion}"
shadow "org.apache.logging.log4j:log4j-core:${log4jVersion}"
shadow "${flinkGroup}:flink-clients:${flinkVersion}"
shadow "${flinkGroup}:flink-java:${flinkVersion}"
shadow "${flinkGroup}:flink-streaming-java:${flinkVersion}"
if (project != project(":common")) {
implementation project(path: ':common')
}
}
spotless {
format 'misc', {
// define the files to apply `misc` to
target '*.gradle', '*.md', '.gitignore'
// define the steps to apply to those files
trimTrailingWhitespace()
indentWithSpaces(4)
endWithNewline()
}
java {
googleJavaFormat('1.7')
removeUnusedImports()
}
}
jar {
archiveClassifier.set('original')
manifest {
attributes 'Built-By': System.getProperty('user.name'),
'Build-Jdk': System.getProperty('java.version')
}
}
shadowJar {
mergeServiceFiles()
archiveClassifier.set('')
dependencies {
exclude(dependency("${flinkGroup}:force-shading"))
exclude(dependency('com.google.code.findbugs:jsr305'))
exclude(dependency('org.slf4j:.*'))
exclude(dependency('log4j:.*'))
exclude(dependency('org.apache.logging.log4j:log4j-to-slf4j'))
// already provided dependencies from serializer frameworks
exclude(dependency('com.esotericsoftware.kryo:kryo'))
}
}
assemble.dependsOn(shadowJar)
sourceSets {
// Add shadow configuration to runtime class path so that the
// dynamically-generated tasks by IntelliJ are able to run and have
// all dependencies they need. (Luckily, this does not influence what
// ends up in the final shadowJar.)
main.runtimeClasspath += configurations.shadow
test.compileClasspath += configurations.shadow
test.runtimeClasspath += configurations.shadow
}
// add FLINK_TRAINING_LOCAL to the environment variables if run via gradle
tasks.matching({ task -> task instanceof JavaExec }).all {
environment "FLINK_TRAINING_LOCAL", "1"
}
publishing {
repositories {
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/" + (System.getenv("GITHUB_REPOSITORY") ?: "ververica/lab-flink-repository-analytics")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}
}