-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
170 lines (141 loc) · 4.79 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
/*
* Copyright 2019 - 2021 Aiven Oy
*
* Licensed 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 {
// https://docs.gradle.org/current/userguide/java_library_plugin.html
id "java-library"
// https://docs.gradle.org/current/userguide/checkstyle_plugin.html
id "checkstyle"
// https://docs.gradle.org/current/userguide/jacoco_plugin.html
id "jacoco"
// https://docs.gradle.org/current/userguide/distribution_plugin.html
id "distribution"
// https://docs.gradle.org/current/userguide/publishing_maven.html
id "maven-publish"
}
repositories {
mavenCentral()
}
group = "io.aiven"
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
withJavadocJar()
withSourcesJar()
}
wrapper {
distributionType = "ALL"
doLast {
def sha256Sum = new String(new URL("${distributionUrl}.sha256").bytes)
propertiesFile << "distributionSha256Sum=${sha256Sum}\n"
println "Added checksum to wrapper properties"
}
}
ext {
kafkaVersion = "2.2.0"
slf4jVersion = "2.0.12"
elasticJavaClientVersion = "7.17.18"
testContainersElasticVersion = "1.20.3"
carrotsearchVersion = "2.8.1"
}
compileJava {
options.compilerArgs = ["-Xlint:all", "-Werror"]
}
checkstyle {
toolVersion "9.2.1"
getConfigDirectory().set(rootProject.file("checkstyle/"))
}
jacoco {
toolVersion = "0.8.7"
}
dependencies {
compileOnly("org.apache.kafka:connect-api:$kafkaVersion")
compileOnly("org.apache.kafka:connect-json:$kafkaVersion")
implementation("org.slf4j:slf4j-api:$slf4jVersion")
implementation("co.elastic.clients:elasticsearch-java:$elasticJavaClientVersion")
testImplementation("junit:junit:4.13.2") {
exclude(group: "org.hamcrest", module: "hamcrest-core")
}
testImplementation("org.hamcrest:hamcrest-all:1.3")
testImplementation("org.mockito:mockito-core:5.14.2")
testImplementation("org.mockito:mockito-all:1.10.19")
testImplementation("org.apache.kafka:connect-json:$kafkaVersion")
testImplementation("org.testcontainers:elasticsearch:$testContainersElasticVersion")
testImplementation("com.carrotsearch.randomizedtesting:randomizedtesting-runner:$carrotsearchVersion")
testRuntimeOnly("org.slf4j:slf4j-log4j12:$slf4jVersion")
}
distributions {
main {
contents {
from jar
from configurations.runtimeClasspath
into("/") {
from projectDir
include "version.txt", "README*", "LICENSE*", "NOTICE*", "licenses/"
include "config/"
}
}
}
}
publishing {
publications {
maven(MavenPublication) {
// Defaults, for clarity
groupId = getGroup()
artifactId = getName()
version = getVersion()
pom {
name = "Aiven's Elasticsearch Sink Connector for Apache Kafka"
description = "A Kafka Connect sink connector for copying data from Kafka to Elasticsearch."
url = "https://aiven.io"
organization {
name = "Aiven Oy"
url = "https://aiven.io"
}
licenses {
license {
name = "Apache License 2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0.html"
distribution = "repo"
}
}
scm {
connection = "scm:git:git://github.com/aiven/elasticsearch-connector-for-apache-kafka.git"
developerConnection = "scm:git:git@github.com:aiven/elasticsearch-connector-for-apache-kafka.git"
url = "https://github.com/aiven/elasticsearch-connector-for-apache-kafka.git"
tag = "HEAD"
}
}
}
}
}
processResources {
filesMatching("elasticsearch-connector-for-apache-kafka-version.properties") {
expand(version: version)
}
}
jar {
manifest {
attributes(
'Version': "${project.version}"
)
}
}
def elasticsearch7Test = tasks.register("elasticsearch7Test", Test) {
environment("ELASTIC_TEST_CONTAINER_VERSION", "7.17.0")
}
tasks.named("check") {
dependsOn elasticsearch7Test
}