17
17
// Licensed Materials - Property of IBM
18
18
// © Copyright IBM Corp. 2015-2018
19
19
//
20
-
21
20
plugins {
22
21
id ' application'
23
22
id ' java'
24
- id ' com.github.johnrengelman.shadow' version ' 4.0.2 '
23
+ id ' com.github.johnrengelman.shadow' version ' 7.1.0 '
25
24
id ' eclipse'
26
- id ' com.commercehub. gradle.plugin.avro' version ' 0.21.0 '
25
+ id " com.github.davidmc24. gradle.plugin.avro" version " 1.3.0 "
27
26
}
28
27
29
28
group = ' com.ibm.eventstreams.samples'
@@ -42,68 +41,26 @@ repositories {
42
41
43
42
dependencies {
44
43
implementation ' org.apache.kafka:kafka-clients:2.7.+'
45
- implementation ' log4j:log4j:1.2.17'
46
- implementation ' org.slf4j:slf4j-log4j12:1.7.25'
44
+ implementation group : ' org.apache.logging.log4j' , name : ' log4j-core' , version : ' 2.17.+'
45
+ implementation group : ' org.apache.logging.log4j' , name : ' log4j-api' , version : ' 2.17.+'
46
+ implementation ' org.apache.logging.log4j:log4j-slf4j-impl:2.17.+'
47
47
implementation ' com.fasterxml.jackson.core:jackson-databind:2.9.+'
48
- implementation ' io.confluent:kafka-avro-serializer:5.3.+'
49
- implementation ' org.apache.avro:avro:1.10.+'
50
- }
51
-
52
- task downloadDependencies (type : Exec ) {
53
- configurations. testRuntimeClasspath. files
54
- commandLine ' echo' , ' Downloaded all dependencies'
48
+ implementation ' io.confluent:kafka-avro-serializer:6.2.+'
49
+ implementation ' org.apache.avro:avro:1.11.+'
55
50
}
56
51
57
- task generateAvro (type : com.commercehub.gradle.plugin.avro.GenerateAvroJavaTask ) {
58
- source(" src/main/avro" )
59
- outputDir = file(" build/generated/sources/avro/java/main/resources" )
60
- }
61
-
62
- // compileJava.source(generateAvro.outputs)
63
52
avro {
64
53
createSetters = false
65
54
fieldVisibility = " PRIVATE"
66
55
}
67
56
68
- // Compile source code
69
- compileJava {
70
- doFirst {
71
- copy {
72
- from configurations. runtimeClasspath
73
- into ' lib'
74
- }
75
- }
76
-
77
- source = [' src' , generateAvro. outputs]
78
- options. encoding = ' ISO-8859-1'
79
- }
80
-
81
57
jar {
58
+ archiveClassifier. set(' no-deps' )
59
+ }
60
+ shadowJar {
82
61
from " resources/log4j.properties"
83
-
84
- doLast {
85
- copy {
86
- from ' resources'
87
- into ' build/libs/resources'
88
- }
89
-
90
- copy {
91
- from ' lib'
92
- into ' build/libs/lib'
93
- }
94
- }
95
-
96
- // Provide Main-Class so the JAR executes properly, along with the required classpath data.
62
+ archiveClassifier. set(' ' )
97
63
manifest {
98
- attributes(' Main-Class' : mainClassName,
99
- ' Class-Path' : configurations. runtimeClasspath. files. collect { ' ./lib/' + it. name }. join(' ' ))
64
+ attributes(' Main-Class' : mainClassName)
100
65
}
101
66
}
102
-
103
- sourceSets {
104
- main {
105
- java {
106
- srcDirs = [" src/main/java" , " src/main/resources" ]
107
- }
108
- }
109
- }
0 commit comments