diff --git a/build.gradle b/build.gradle
index 6bb45a614e9..6373c77877b 100644
--- a/build.gradle
+++ b/build.gradle
@@ -73,6 +73,7 @@ allprojects {
checkstyle {
toolVersion "${checkStyleVersion}"
configFile file("$rootDir/buildtools/src/main/resources/bookkeeper/checkstyle.xml")
+ configDirectory = file("$rootDir/buildtools/src/main/resources/bookkeeper")
checkstyleMain {
source ='src/main/java'
}
diff --git a/buildtools/src/main/resources/bookkeeper/checkstyle.xml b/buildtools/src/main/resources/bookkeeper/checkstyle.xml
index b79bfdd3f24..fda4fb619d6 100644
--- a/buildtools/src/main/resources/bookkeeper/checkstyle.xml
+++ b/buildtools/src/main/resources/bookkeeper/checkstyle.xml
@@ -60,7 +60,7 @@ page at http://checkstyle.sourceforge.net/config.html -->
-
+
diff --git a/circe-checksum/build.gradle b/circe-checksum/build.gradle
index 17258fee0b2..5e03ec9324e 100644
--- a/circe-checksum/build.gradle
+++ b/circe-checksum/build.gradle
@@ -28,14 +28,8 @@ dependencies {
testImplementation depLibs.mockito
}
-task generateJniHeaders(type:Exec) {
- ext {
- javahOutputDir = "$buildDir/javahGenerated"
- }
- dependsOn classes
- def classpath = sourceSets.main.output.classesDirs.join(":")
- commandLine("javah", "-d", javahOutputDir, "-classpath",
- classpath, "com.scurrilous.circe.crc.Sse42Crc32C")
+compileJava {
+ options.headerOutputDirectory = file("${buildDir}/javahGenerated")
}
jar {
diff --git a/circe-checksum/src/main/circe/build.gradle b/circe-checksum/src/main/circe/build.gradle
index 5b49ba82885..0a35c874aab 100644
--- a/circe-checksum/src/main/circe/build.gradle
+++ b/circe-checksum/src/main/circe/build.gradle
@@ -27,9 +27,9 @@ library {
binaries.configureEach { CppBinary binary ->
def compileTask = binary.compileTask.get()
- compileTask.dependsOn project(':circe-checksum').generateJniHeaders
+ compileTask.dependsOn project(':circe-checksum').compileJava
compileTask.includes.from("${Jvm.current().javaHome}/include",
- project(':circe-checksum').generateJniHeaders.javahOutputDir)
+ project(':circe-checksum').compileJava.options.headerOutputDirectory)
def osFamily = binary.targetPlatform.targetMachine.operatingSystemFamily
diff --git a/cpu-affinity/build.gradle b/cpu-affinity/build.gradle
index 981fd6df381..750f7a2802d 100644
--- a/cpu-affinity/build.gradle
+++ b/cpu-affinity/build.gradle
@@ -16,29 +16,25 @@
* specific language governing permissions and limitations
* under the License.
*/
+
plugins {
id 'java'
}
dependencies {
- compileOnly depLibs.lombok
compileOnly depLibs.spotbugsAnnotations
implementation depLibs.commonsLang3
implementation depLibs.guava
implementation depLibs.slf4j
testImplementation depLibs.junit
-
+ compileOnly depLibs.lombok
annotationProcessor depLibs.lombok
+ testCompileOnly depLibs.lombok
+ testAnnotationProcessor depLibs.lombok
}
-task generateJniHeaders(type:Exec) {
- ext {
- javahOutputDir = "$buildDir/javahGenerated"
- }
- dependsOn classes
- def classpath = sourceSets.main.output.classesDirs.join(":")
- commandLine("javah", "-d", javahOutputDir, "-classpath",
- classpath, "org.apache.bookkeeper.common.util.affinity.impl.CpuAffinityJni")
+compileJava {
+ options.headerOutputDirectory = file("${buildDir}/javahGenerated")
}
jar {
diff --git a/cpu-affinity/src/main/affinity/build.gradle b/cpu-affinity/src/main/affinity/build.gradle
index 2e444234fad..49868c0c515 100644
--- a/cpu-affinity/src/main/affinity/build.gradle
+++ b/cpu-affinity/src/main/affinity/build.gradle
@@ -25,9 +25,9 @@ plugins {
library {
binaries.configureEach { CppBinary binary ->
def compileTask = binary.compileTask.get()
- compileTask.dependsOn project(':cpu-affinity').generateJniHeaders
+ compileTask.dependsOn project(':cpu-affinity').compileJava
compileTask.includes.from("${Jvm.current().javaHome}/include",
- project(':cpu-affinity').generateJniHeaders.javahOutputDir)
+ project(':cpu-affinity').compileJava.options.headerOutputDirectory)
def osFamily = binary.targetPlatform.targetMachine.operatingSystemFamily
diff --git a/dependencies.gradle b/dependencies.gradle
index 1f34a813a74..aee92d74d72 100644
--- a/dependencies.gradle
+++ b/dependencies.gradle
@@ -48,6 +48,7 @@ depVersions = [
hdrhistogram: "2.1.4",
httpclient: "4.5.13",
jackson: "2.11.1",
+ javaAnnotations:"1.3.2",
jcommander: "1.78",
jctools: "2.1.2",
jetty: "9.4.31.v20200723",
@@ -111,6 +112,7 @@ depLibs = [
hamcrest: "org.hamcrest:hamcrest-all:${depVersions.hamcrest}",
httpclient: "org.apache.httpcomponents:httpclient:${depVersions.httpclient}",
jacksonAnnotations: "com.fasterxml.jackson.core:jackson-annotations:${depVersions.jackson}",
+ javaAnnotations: "javax.annotation:javax.annotation-api:${depVersions.javaAnnotations}",
jacksonCore: "com.fasterxml.jackson.core:jackson-core:${depVersions.jackson}",
jacksonDatabind: "com.fasterxml.jackson.core:jackson-databind:${depVersions.jackson}",
jcommander: "com.beust:jcommander:${depVersions.jcommander}",
diff --git a/stream/distributedlog/core/build.gradle b/stream/distributedlog/core/build.gradle
index e4a65eacbef..ca739376dec 100644
--- a/stream/distributedlog/core/build.gradle
+++ b/stream/distributedlog/core/build.gradle
@@ -49,6 +49,7 @@ dependencies {
testImplementation project(path: ':stream:distributedlog:common', configuration: 'testArtifacts')
testImplementation depLibs.junit
testImplementation depLibs.mockito
+ implementation depLibs.javaAnnotations
annotationProcessor depLibs.lombok
testAnnotationProcessor depLibs.lombok
diff --git a/stream/proto/build.gradle b/stream/proto/build.gradle
index cd90529e2b7..cc27288f437 100644
--- a/stream/proto/build.gradle
+++ b/stream/proto/build.gradle
@@ -25,6 +25,7 @@ dependencies {
implementation depLibs.lombok
implementation depLibs.grpc
implementation depLibs.commonsLang3
+ implementation depLibs.javaAnnotations
annotationProcessor depLibs.lombok
}
diff --git a/stream/server/build.gradle b/stream/server/build.gradle
index 08f2403ac4e..7eb3510848e 100644
--- a/stream/server/build.gradle
+++ b/stream/server/build.gradle
@@ -55,6 +55,7 @@ dependencies {
runtimeOnly depLibs.vertxCore
runtimeOnly depLibs.vertxWeb
testImplementation depLibs.mockito
+ implementation depLibs.javaAnnotations
annotationProcessor depLibs.lombok
}
diff --git a/stream/tests-common/build.gradle b/stream/tests-common/build.gradle
index f3c33c78c56..5259cd6e0e9 100644
--- a/stream/tests-common/build.gradle
+++ b/stream/tests-common/build.gradle
@@ -26,6 +26,7 @@ dependencies {
implementation depLibs.slf4j
annotationProcessor depLibs.lombok
+ implementation depLibs.javaAnnotations
}
protobuf {