forked from lensesio/kafka-connect-common
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
223 lines (194 loc) · 7.4 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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
/*
* Copyright 2017 Datamountaineer.
*
* 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.
*/
buildscript {
repositories {
jcenter()
maven {
url 'https://plugins.gradle.org/m2/'
}
}
dependencies {
classpath 'com.github.maiflai:gradle-scalatest:0.25'
classpath 'io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.9.0'
classpath 'net.researchgate:gradle-release:2.8.1'
}
}
apply plugin: 'java'
apply plugin: 'scala'
apply plugin: 'com.github.maiflai.scalatest'
apply plugin: 'signing'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'io.codearte.nexus-staging'
group = 'com.datamountaineer'
version = version
description = "kafka-connect-common"
sourceCompatibility = 1.8
targetCompatibility = 1.8
allprojects {
ext {
scalaMajorVersion = '2.12'
scala = '2.12.10'
scalaCheck = '1.14.3'
scalaTest = '3.1.1'
junit = '4.12'
confluentVersion = '5.4.0'
scalaLoggingVersion = '3.9.2'
kafkaVersion = '2.4.0'
mockitoVersion = '1.13.0'
avroVersion = '1.8.2'
avro4sVersion = "1.6.4"
guavaVersion = "18.0"
json4sVersion = "3.6.7"
kcqlVersion = "2.8.7"
smt = "2.0.0"
}
repositories {
mavenLocal()
mavenCentral()
maven { url "https://packages.confluent.io/maven/" }
maven { url "https://repo.typesafe.com/typesafe/releases/" }
}
configurations {
provided
compile.extendsFrom provided
}
dependencies {
provided "org.scala-lang:scala-library:$scala"
provided "org.scala-lang:scala-compiler:$scala"
provided "com.typesafe.scala-logging:scala-logging_${scalaMajorVersion}:${scalaLoggingVersion}"
provided "org.apache.kafka:connect-json:$kafkaVersion"
provided "io.confluent:kafka-connect-avro-converter:$confluentVersion"
provided "io.confluent:kafka-schema-registry:$confluentVersion"
provided "org.apache.avro:avro:$avroVersion"
implementation "com.sksamuel.avro4s:avro4s-core_$scalaMajorVersion:$avro4sVersion"
implementation "org.json4s:json4s-native_$scalaMajorVersion:$json4sVersion"
implementation "org.json4s:json4s-jackson_$scalaMajorVersion:$json4sVersion"
implementation("com.landoop:kafka-connect-smt_$scalaMajorVersion:$smt"){
exclude group: "com.google.protobuf"
exclude group: "org.apache.calcite", module:"calcite-linq4j"
exclude group: "org.apache.httpcomponents"
}
implementation("com.datamountaineer:kcql:$kcqlVersion") {
exclude group: "com.google.guava", module: "guava"
}
testImplementation "org.mockito:mockito-scala_$scalaMajorVersion:$mockitoVersion"
testImplementation "org.scalacheck:scalacheck_$scalaMajorVersion:$scalaCheck"
testImplementation "org.scalatest:scalatest_$scalaMajorVersion:$scalaTest"
testImplementation "junit:junit:$junit"
testImplementation "org.apache.curator:curator-test:3.1.0"
testImplementation 'org.powermock:powermock-module-junit4:1.6.5'
testImplementation 'org.pegdown:pegdown:1.1.0'
testImplementation "com.vladsch.flexmark:flexmark-all:0.35.10"
}
jar {
dependsOn configurations.runtimeClasspath
from {
(configurations.runtimeClasspath - configurations.provided).collect {
it.isDirectory() ? it : zipTree(it)
}
} {
exclude "META-INF/*.SF"
exclude "META-INF/*.DSA"
exclude "META-INF/*.RSA"
}
jar.archiveFileName = "$project.name-$project.version-$confluentVersion-all.jar"
}
test {
maxParallelForks = 1
minHeapSize '256m'
maxHeapSize '2048m'
systemProperty 'keystore', projectDir.canonicalPath + "/src/test/resources/stc_keystore.jks"
systemProperty 'truststore', projectDir.canonicalPath + "/src/test/resources/stc_truststore.jks"
}
task testJar(type: Jar, dependsOn: testClasses) {
archiveFileName = "test-${project.archivesBaseName}"
from sourceSets.test.output
}
configurations {
tests
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
task scaladocJar(type: Jar) {
classifier = 'scaladoc'
from '../LICENSE'
from scaladoc
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
task compile(dependsOn: 'compileScala')
javadoc.dependsOn scaladoc
artifacts {
archives javadocJar, scaladocJar, sourcesJar
}
signing {
required { gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}
nexusStaging {
username ossrhUsername
password ossrhPassword
numberOfRetries = 100
delayBetweenRetriesInMillis = 3000
}
// OSSRH publication
if (project.hasProperty('release')) {
uploadArchives {
repositories {
mavenDeployer {
// POM signature
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
// Target repository
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
pom.project {
name project.name
description project.description
packaging 'jar'
url 'https://github.com/lensesio/kafka-connect-common'
scm {
connection 'scm:git:https://github.com/lensesio/kafka-connect-common.git'
developerConnection 'scm:git:[email protected]:lensesio/kafka-connect-common.git'
url 'https://github.com/lensesio/kafka-connect-common.git'
}
licenses {
license {
name 'Apache License 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.html'
distribution 'repo'
}
}
developers {
developer {
id = 'andrewstevenson'
name = 'Andrew Stevenson'
email = '[email protected]'
}
}
}
}
}
}
}
}
project.tasks.compileScala.scalaCompileOptions.additionalParameters = ["-target:jvm-1.8"]
project.tasks.compileTestScala.scalaCompileOptions.additionalParameters = ["-target:jvm-1.8"]