diff --git a/.github/workflows/compatibility-check-java11.yml b/.github/workflows/compatibility-check-java11.yml index 4a49a9aeaa9..3f1306820fb 100644 --- a/.github/workflows/compatibility-check-java11.yml +++ b/.github/workflows/compatibility-check-java11.yml @@ -29,9 +29,6 @@ on: - 'site/**' workflow_dispatch: -env: - MAVEN_OPTS: -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 -Dmaven.wagon.http.retryHandler.count=3 - jobs: check: @@ -48,5 +45,7 @@ jobs: uses: actions/setup-java@v1 with: java-version: 1.11 - - name: Build with Maven - run: mvn clean package -B -nsu -DskipBookKeeperServerTests -Dorg.slf4j.simpleLogger.defaultLogLevel=INFO + - name: Build with gradle + run: ./gradlew test -x bookkeeper-server:test -x tests:integration:cluster:test -x tests:integration:smoke:test -x tests:integration:standalone:test -Dtestlogger.theme=plain + -PexcludeTests="*.apache.distributedlog.*, *.apache.bookkeeper.statelib.*, *.apache.bookkeeper.clients.*, *.apache.bookkeeper.common.*, *.apache.bookkeeper.stream.*" + diff --git a/.github/workflows/compatibility-check-java8.yml b/.github/workflows/compatibility-check-java8.yml index fda71a59317..8caa43c8740 100644 --- a/.github/workflows/compatibility-check-java8.yml +++ b/.github/workflows/compatibility-check-java8.yml @@ -29,9 +29,6 @@ on: - 'site/**' workflow_dispatch: -env: - MAVEN_OPTS: -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 -Dmaven.wagon.http.retryHandler.count=3 - jobs: check: @@ -48,5 +45,9 @@ jobs: uses: actions/setup-java@v1 with: java-version: 1.8 - - name: Build with Maven - run: mvn clean package -B -nsu spotbugs:check -DskipBookKeeperServerTests -Dorg.slf4j.simpleLogger.defaultLogLevel=INFO + - name: Build with gradle + run: ./gradlew test -x bookkeeper-server:test + -x tests:integration:cluster:test + -x tests:integration:smoke:test + -x tests:integration:standalone:test -Dtestlogger.theme=plain + -PexcludeTests="*.apache.distributedlog.*, *.apache.bookkeeper.statelib.*, *.apache.bookkeeper.clients.*, *.apache.bookkeeper.common.*, *.apache.bookkeeper.stream.*" diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 97a3c82702c..297c3b06c7b 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -48,11 +48,12 @@ jobs: uses: actions/setup-java@v1 with: java-version: 1.8 - - name: Build with Maven - run: mvn -B -nsu clean install -Pdocker -DskipTests -Dorg.slf4j.simpleLogger.defaultLogLevel=INFO - - name: Run metadata driver tests - run: mvn -B -nsu -f metadata-drivers/pom.xml test -DintegrationTests -Dorg.slf4j.simpleLogger.defaultLogLevel=INFO - - - name: Run all integration tests - run: mvn -B -nsu -f tests/pom.xml test -DintegrationTests -Dorg.slf4j.simpleLogger.defaultLogLevel=INFO + - name: Build tar + run: ./gradlew stream:server:build -x test + - name: run cluster integration test + run: ./gradlew :tests:integration:cluster:test -Dtestlogger.theme=plain + - name: run smoke test + run: ./gradlew tests:integration:smoke:test -Dtestlogger.theme=plain + - name: run standalone test + run: ./gradlew tests:integration:standalone:test -Dtestlogger.theme=plain diff --git a/.github/workflows/pr-validation.yml b/.github/workflows/pr-validation.yml index edcebaa484b..34337159b81 100644 --- a/.github/workflows/pr-validation.yml +++ b/.github/workflows/pr-validation.yml @@ -29,8 +29,6 @@ on: - 'site/**' workflow_dispatch: -env: - MAVEN_OPTS: -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 -Dmaven.wagon.http.retryHandler.count=3 jobs: check: @@ -48,7 +46,7 @@ jobs: uses: actions/setup-java@v1 with: java-version: 1.8 - - name: Validate pull request style - run: mvn clean -B -nsu apache-rat:check checkstyle:check package -Ddistributedlog -DskipTests -Dorg.slf4j.simpleLogger.defaultLogLevel=INFO + - name: Validate pull request + run: ./gradlew build -x microbenchmarks:checkstyleMain -x spotbugsTest -x signDistTar -x test - name: Check license files - run: dev/check-all-licenses + run: dev/check-all-licenses-gradle diff --git a/.github/workflows/remaining-tests.yml b/.github/workflows/remaining-tests.yml index 6176aa42ec0..90cb641fc3a 100644 --- a/.github/workflows/remaining-tests.yml +++ b/.github/workflows/remaining-tests.yml @@ -29,9 +29,6 @@ on: - 'site/**' workflow_dispatch: -env: - MAVEN_OPTS: -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 -Dmaven.wagon.http.retryHandler.count=3 - jobs: test: @@ -49,4 +46,4 @@ jobs: with: java-version: 1.8 - name: Run remaining tests - run: mvn -B -nsu -am -pl bookkeeper-server clean install test -Dtest="!org.apache.bookkeeper.client.**,!org.apache.bookkeeper.bookie.**,!org.apache.bookkeeper.replication.**,!org.apache.bookkeeper.tls.**" -DfailIfNoTests=false -Dorg.slf4j.simpleLogger.defaultLogLevel=INFO + run: ./gradlew bookkeeper-server:test -PexcludeTests="*org.apache.bookkeeper.bookie.*, *org.apache.bookkeeper.client.*, *org.apache.bookkeeper.replication.*, *org.apache.bookkeeper.tls.*" -Dtestlogger.theme=plain \ No newline at end of file diff --git a/.github/workflows/replication-tests.yml b/.github/workflows/replication-tests.yml index 8dd6ea6ee6c..c5bd88ea081 100644 --- a/.github/workflows/replication-tests.yml +++ b/.github/workflows/replication-tests.yml @@ -49,4 +49,4 @@ jobs: with: java-version: 1.8 - name: Run replication tests - run: mvn -B -nsu -am -pl bookkeeper-server clean install test -Dtest="org.apache.bookkeeper.replication.**" -DfailIfNoTests=false -Dorg.slf4j.simpleLogger.defaultLogLevel=INFO + run: ./gradlew bookkeeper-server:test --tests="org.apache.bookkeeper.replication.*" -Dtestlogger.theme=plain diff --git a/.github/workflows/stream-tests.yml b/.github/workflows/stream-tests.yml index ca4a7074f5a..c6584334361 100644 --- a/.github/workflows/stream-tests.yml +++ b/.github/workflows/stream-tests.yml @@ -28,9 +28,6 @@ on: - 'site/**' workflow_dispatch: -env: - MAVEN_OPTS: -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 -Dmaven.wagon.http.retryHandler.count=3 - jobs: test: @@ -47,7 +44,20 @@ jobs: uses: actions/setup-java@v1 with: java-version: 1.8 - - name: Build with Maven - run: mvn -B -nsu clean install -DskipTests -Dorg.slf4j.simpleLogger.defaultLogLevel=INFO - - name: Run StreamStorage tests - run: mvn -B -nsu -f stream/pom.xml verify -DstreamTests -Dorg.slf4j.simpleLogger.defaultLogLevel=INFO + - name: Run stream:distributedlog:core tests + run: ./gradlew stream:distributedlog:core:test -Dtestlogger.theme=plain + - name: Run stream:distributedlog:common tests + run: ./gradlew stream:distributedlog:common:test -Dtestlogger.theme=plain + - name: Run stream:distributedlog:protocol tests + run: ./gradlew stream:distributedlog:protocol:test -Dtestlogger.theme=plain + - name: Run stream:proto tests + run: ./gradlew stream:proto:test -Dtestlogger.theme=plain + - name: Run stream:serve tests + run: ./gradlew stream:server:test -Dtestlogger.theme=plain + - name: Run stream:statelib tests + run: ./gradlew stream:statelib:test -Dtestlogger.theme=plain + - name: Run stream:storage:api:test tests + run: ./gradlew stream:storage:api:test -Dtestlogger.theme=plain + - name: Run stream:storage:impl tests + run: ./gradlew stream:storage:impl:test -Dtestlogger.theme=plain + diff --git a/.github/workflows/tls-tests.yml b/.github/workflows/tls-tests.yml index 45748c25fb7..00fb6f3d9db 100644 --- a/.github/workflows/tls-tests.yml +++ b/.github/workflows/tls-tests.yml @@ -29,9 +29,6 @@ on: - 'site/**' workflow_dispatch: -env: - MAVEN_OPTS: -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 -Dmaven.wagon.http.retryHandler.count=3 - jobs: test: @@ -49,4 +46,4 @@ jobs: with: java-version: 1.8 - name: Run tls tests - run: mvn -B -am -nsu -pl bookkeeper-server clean install test -Dtest="org.apache.bookkeeper.tls.**" -DfailIfNoTests=false -Dorg.slf4j.simpleLogger.defaultLogLevel=INFO + run: ./gradlew bookkeeper-server:test --tests="org.apache.bookkeeper.tls.*" -Dtestlogger.theme=plain diff --git a/bookkeeper-benchmark/build.gradle b/bookkeeper-benchmark/build.gradle index 00e1cf7d178..6f428f697de 100644 --- a/bookkeeper-benchmark/build.gradle +++ b/bookkeeper-benchmark/build.gradle @@ -18,6 +18,8 @@ */ plugins { id 'java-library' + id 'com.adarshr.test-logger' + id 'org.gradle.test-retry' } description = 'Apache BookKeeper :: Benchmark' @@ -39,7 +41,7 @@ dependencies { implementation depLibs.nettyBuffer implementation depLibs.nettyTransportNativeEpoll implementation depLibs.zookeeper - + implementation depLibs.log4j12api testImplementation project(':bookkeeper-server') testImplementation project(path: ':bookkeeper-common', configuration: 'testArtifacts') @@ -57,6 +59,11 @@ dependencies { } test { + retry { + maxFailures = 10 + maxRetries = 3 + } + maxHeapSize = '4G' forkEvery = 1 jvmArgs("-Djunit.timeout.test=600000", diff --git a/bookkeeper-common-allocator/build.gradle b/bookkeeper-common-allocator/build.gradle index 57f6b590340..5685b25a34c 100644 --- a/bookkeeper-common-allocator/build.gradle +++ b/bookkeeper-common-allocator/build.gradle @@ -18,6 +18,7 @@ */ plugins { id 'java-library' + id 'com.adarshr.test-logger' } dependencies { diff --git a/bookkeeper-common/build.gradle b/bookkeeper-common/build.gradle index 94b5b36d63c..4b44f6815f3 100644 --- a/bookkeeper-common/build.gradle +++ b/bookkeeper-common/build.gradle @@ -19,13 +19,15 @@ plugins { id 'java-library' id "java-test-fixtures" + id 'com.adarshr.test-logger' + id 'org.gradle.test-retry' } dependencies { implementation project(":bookkeeper-stats") implementation project(":cpu-affinity") - compileOnly depLibs.errorprone + implementation depLibs.errorprone compileOnly depLibs.jsr305 compileOnly depLibs.lombok compileOnly depLibs.spotbugsAnnotations @@ -50,3 +52,12 @@ dependencies { testAnnotationProcessor depLibs.lombok } +test { + retry { + maxFailures = 20 + maxRetries = 3 + } + + maxHeapSize = '3G' + forkEvery = 1 +} \ No newline at end of file diff --git a/bookkeeper-dist/all/build.gradle b/bookkeeper-dist/all/build.gradle index 343f01a7111..205cdf26d4f 100644 --- a/bookkeeper-dist/all/build.gradle +++ b/bookkeeper-dist/all/build.gradle @@ -25,7 +25,6 @@ plugins { description = 'Apache BookKeeper :: Dist (All)' dependencies { - implementation project(':bookkeeper-benchmark') implementation project(':bookkeeper-http:http-server') implementation project(':bookkeeper-http:vertx-http-server') @@ -36,18 +35,13 @@ dependencies { implementation project(':stream:distributedlog:core') implementation project(':stream:server') implementation project(':bookkeeper-tools') - - compileOnly depLibs.lombok - compileOnly depLibs.spotbugsAnnotations - - implementation depLibs.log4j12api - - - testCompileOnly depLibs.lombok - - - annotationProcessor depLibs.lombok - testAnnotationProcessor depLibs.lombok + implementation depLibs.jsr305 + runtimeOnly depLibs.log4j12api + implementation (depLibs.zookeeperTest) { + exclude group: "io.netty", module: "netty-transport-native-epoll" + exclude group: 'log4j', module: 'log4j' + exclude group: 'org.slf4j', module: 'slf4j-log4j12' + } } jar { @@ -116,7 +110,11 @@ distributions { } else { // External dependencies def id = dep.moduleVersion.id - archiveName = "${id.group}-${id.name}-${id.version}.jar" + if (dep.classifier != null) { + archiveName = "${id.group}-${id.name}-${id.version}-${dep.classifier}.jar" + } else { + archiveName = "${id.group}-${id.name}-${id.version}.jar" + } } rename {archiveName} } diff --git a/bookkeeper-dist/bkctl/build.gradle b/bookkeeper-dist/bkctl/build.gradle index 691f09bc0e4..eda3c96d978 100644 --- a/bookkeeper-dist/bkctl/build.gradle +++ b/bookkeeper-dist/bkctl/build.gradle @@ -25,7 +25,19 @@ plugins { } dependencies { - implementation project(":bookkeeper-tools") + implementation (project(":bookkeeper-tools")) { + exclude group: "org.rocksdb", module: "rocksdbjni" + } + runtimeOnly (depLibs.zookeeperTest) { + exclude group: "io.netty", module: "netty-transport-native-epoll" + exclude group: 'log4j', module: 'log4j' + exclude group: 'org.slf4j', module: 'slf4j-log4j12' + } + runtimeOnly (project(':bookkeeper-stats-providers:codahale-metrics-provider')) { + exclude group: "io.dropwizard.metrics", module: "metrics-graphite" + exclude group: "io.dropwizard.metrics", module: "metrics-jvm" + } + runtimeOnly depLibs.snappy } releaseArtifacts { @@ -35,7 +47,6 @@ releaseArtifacts { def depLicences = [ "checker-qual-3.5.0/LICENSE", "google-auth-library-credentials-0.20.0/LICENSE", - "javax.servlet-api-4.0.0/CDDL+GPL-1.1", "netty-4.1.68.Final/*", "bouncycastle-1.0.2/LICENSE.html", "protobuf-3.14.0/LICENSE", @@ -99,7 +110,11 @@ distributions { } else { // External dependencies def id = dep.moduleVersion.id - archiveName = "${id.group}-${id.name}-${id.version}.jar" + if (dep.classifier != null) { + archiveName = "${id.group}-${id.name}-${id.version}-${dep.classifier}.jar" + } else { + archiveName = "${id.group}-${id.name}-${id.version}.jar" + } } rename {archiveName} } diff --git a/bookkeeper-dist/server/build.gradle b/bookkeeper-dist/server/build.gradle index 6ce817ddf9f..d10add5b587 100644 --- a/bookkeeper-dist/server/build.gradle +++ b/bookkeeper-dist/server/build.gradle @@ -28,28 +28,20 @@ releaseArtifacts { artifact(tasks.named("distTar")) } -// implementation project(':bookkeeper-http:vertx-http-server') dependencies { - - implementation project(':bookkeeper-http:http-server') implementation project(':bookkeeper-server') implementation project(':bookkeeper-stats-providers:prometheus-metrics-provider') implementation project(':bookkeeper-stats') implementation project(':stream:distributedlog:core') implementation project(':stream:server') implementation project(':bookkeeper-tools') - - compileOnly depLibs.lombok - compileOnly depLibs.spotbugsAnnotations - implementation depLibs.log4j12api - - testCompileOnly depLibs.lombok - - - annotationProcessor depLibs.lombok - testAnnotationProcessor depLibs.lombok + runtimeOnly (depLibs.zookeeperTest) { + exclude group: "io.netty", module: "netty-transport-native-epoll" + exclude group: 'log4j', module: 'log4j' + exclude group: 'org.slf4j', module: 'slf4j-log4j12' + } } jar { @@ -106,7 +98,11 @@ distributions { } else { // External dependencies def id = dep.moduleVersion.id - archiveName = "${id.group}-${id.name}-${id.version}.jar" + if (dep.classifier != null) { + archiveName = "${id.group}-${id.name}-${id.version}-${dep.classifier}.jar" + } else { + archiveName = "${id.group}-${id.name}-${id.version}.jar" + } } rename {archiveName} } @@ -116,3 +112,12 @@ distributions { } } } + +publishing { + publications { + maven(MavenPublication) { + groupId = 'org.apache.bookkeeper' + artifactId = 'bookkeeper-dist-server' + } + } +} diff --git a/bookkeeper-http/vertx-http-server/build.gradle b/bookkeeper-http/vertx-http-server/build.gradle index bc01765f956..19dff5a4a28 100644 --- a/bookkeeper-http/vertx-http-server/build.gradle +++ b/bookkeeper-http/vertx-http-server/build.gradle @@ -18,6 +18,7 @@ */ plugins { id 'java' + id 'com.adarshr.test-logger' } dependencies { @@ -25,6 +26,16 @@ dependencies { implementation depLibs.slf4j implementation depLibs.vertxCore implementation depLibs.vertxWeb + implementation depLibs.nettyBuffer + implementation depLibs.nettyCommon + implementation depLibs.nettyHandler + implementation depLibs.nettyTransport + runtimeOnly depLibs.nettyTransportNativeEpoll + implementation depLibs.nettyProxy + implementation depLibs.nettyCodecHTTP + implementation depLibs.nettyCodecHTTP2 + implementation depLibs.nettyResolver + implementation depLibs.nettyResolverDNS testImplementation depLibs.junit } diff --git a/bookkeeper-server/build.gradle b/bookkeeper-server/build.gradle index b18ed013032..1445fbe44af 100644 --- a/bookkeeper-server/build.gradle +++ b/bookkeeper-server/build.gradle @@ -53,6 +53,9 @@ dependencies { implementation depLibs.protobuf implementation depLibs.rocksDb implementation depLibs.zookeeper + implementation depLibs.log4jSlf4jImpl + implementation depLibs.log4j12api + implementation depLibs.log4jCore testImplementation project(':bookkeeper-stats-providers:prometheus-metrics-provider') testImplementation project(':bookkeeper-http:vertx-http-server') @@ -72,9 +75,6 @@ dependencies { testImplementation depLibs.zookeeperTest annotationProcessor depLibs.lombok testAnnotationProcessor depLibs.lombok - testImplementation depLibs.log4jSlf4jImpl - testImplementation depLibs.log4j12api - testImplementation depLibs.log4jCore } test { diff --git a/bookkeeper-stats-providers/codahale-metrics-provider/build.gradle b/bookkeeper-stats-providers/codahale-metrics-provider/build.gradle index 2ac1dbbf17f..a5e1868a883 100644 --- a/bookkeeper-stats-providers/codahale-metrics-provider/build.gradle +++ b/bookkeeper-stats-providers/codahale-metrics-provider/build.gradle @@ -18,6 +18,7 @@ */ plugins { id 'java-library' + id 'com.adarshr.test-logger' } description = 'Apache BookKeeper :: Stats Providers :: Codahale Metrics' diff --git a/bookkeeper-stats-providers/prometheus-metrics-provider/build.gradle b/bookkeeper-stats-providers/prometheus-metrics-provider/build.gradle index f51d0592b8a..dc093500630 100644 --- a/bookkeeper-stats-providers/prometheus-metrics-provider/build.gradle +++ b/bookkeeper-stats-providers/prometheus-metrics-provider/build.gradle @@ -18,6 +18,7 @@ */ plugins { id 'java' + id 'com.adarshr.test-logger' } dependencies { @@ -25,6 +26,7 @@ dependencies { implementation depLibs.commonsConfiguration implementation depLibs.guava implementation depLibs.jettyServlet + implementation depLibs.javaxServlet implementation depLibs.nettyCommon implementation depLibs.prometheusSimpleClient implementation depLibs.prometheusSimpleClientHotspot diff --git a/bookkeeper-stats/build.gradle b/bookkeeper-stats/build.gradle index 70167df9951..98784c9718b 100644 --- a/bookkeeper-stats/build.gradle +++ b/bookkeeper-stats/build.gradle @@ -25,6 +25,10 @@ dependencies { implementation depLibs.slf4j } +jar { + archiveBaseName = 'bookkeeper-stats-api' +} + publishing { publications { maven(MavenPublication) { diff --git a/build.gradle b/build.gradle index 6373c77877b..1938184315e 100644 --- a/build.gradle +++ b/build.gradle @@ -102,6 +102,7 @@ allprojects { '**/out/**', '**/generated/**', '**/build/**', + '**/target/**', '**/.idea/**', '.git/**/*', '.github/**/*', @@ -201,17 +202,24 @@ allprojects { } } test { - String testGroup = System.properties['testGroup'] - if (testGroup == 'client') { - include '**/client/*' - } else if (testGroup == 'bookie') { - include '**/bookie/*' - } else if (testGroup == 'other') { - exclude '**/client/*' - exclude '**/bookie/*' - } - if (project.hasProperty('excludeTests')) { - exclude project.property('excludeTests') + filter { + String testGroup = System.properties['testGroup'] + if (testGroup == 'client') { + include '**/client/*' + } else if (testGroup == 'bookie') { + include '**/bookie/*' + } else if (testGroup == 'other') { + exclude '**/client/*' + exclude '**/bookie/*' + } + if (project.hasProperty('excludeTests')) { + String excludeTests = project.property('excludeTests'); + ArrayList tests = excludeTests.split(','); + tests.forEach({it + String exclude = it.trim(); + excludeTestsMatching exclude; + }); + } } } } diff --git a/circe-checksum/build.gradle b/circe-checksum/build.gradle index 5e03ec9324e..1e7a75fd3e7 100644 --- a/circe-checksum/build.gradle +++ b/circe-checksum/build.gradle @@ -18,6 +18,7 @@ */ plugins { id 'java' + id 'com.adarshr.test-logger' } dependencies { diff --git a/cpu-affinity/build.gradle b/cpu-affinity/build.gradle index 750f7a2802d..3f2cf0d2c74 100644 --- a/cpu-affinity/build.gradle +++ b/cpu-affinity/build.gradle @@ -19,6 +19,7 @@ plugins { id 'java' + id 'com.adarshr.test-logger' } dependencies { diff --git a/dependencies.gradle b/dependencies.gradle index a7bc5bf66bb..6b019f814ed 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -26,8 +26,8 @@ depVersions = [ arquillianJunit: "1.6.0.Final", bcFips: "1.0.2", bouncycastle: "1.69", - commonsCli: "1.4", - commonsCodec: "1.14", + commonsCli: "1.2", + commonsCodec: "1.6", commonsCollections4: "4.1", commonsCompress: "1.19", commonsConfiguration: "1.10", @@ -38,16 +38,18 @@ depVersions = [ curator: "5.1.0", dockerJava: "3.2.5", dropwizard: "3.2.5", - errorprone: "2.1.2", + errorprone: "2.4.0", freebuilder: "2.7.0", + googleHTTPClient: "1.34.0", gradleTooling: "4.0.1", grpc: "1.33.0", groovy: "2.5.8", - guava: "30.1-jre", + guava: "30.0-jre", hamcrest: "1.3", - hdrhistogram: "2.1.4", + hdrhistogram: "2.1.10", httpclient: "4.5.13", - jackson: "2.11.1", + jackson: "2.11.0", + javaxServlet: "4.0.0", javaAnnotations:"1.3.2", jcommander: "1.78", jctools: "2.1.2", @@ -66,19 +68,19 @@ depVersions = [ netty: "4.1.68.Final", nettyTcnativeBoringSsl: "2.0.42.Final", powermock: "2.0.2", - prometheus: "0.0.21", + prometheus: "0.8.1", protobuf: "3.14.0", reflections: "0.9.11", rocksDb: "6.22.1.1", - slf4j: "1.7.30", - snakeyaml: "1.27", + slf4j: "1.7.32", + snakeyaml: "1.19", spotbugsAnnotations: "3.1.8", protocGenGrpcJava: "1.12.0", shrinkwrap:"3.1.4", - snappy: "1.1.7.7", + snappy: "1.1.7", thrift: "0.14.2", testcontainers: "1.15.1", - vertx: "3.9.2", + vertx: "3.9.8", yahooDatasketches: "0.8.3", zookeeper: "3.6.2", ] @@ -99,25 +101,57 @@ depLibs = [ commonsLang2: "commons-lang:commons-lang:${depVersions.commonsLang2}", commonsLang3: "org.apache.commons:commons-lang3:${depVersions.commonsLang3}", commonsBeanutils: "commons-beanutils:commons-beanutils:${depVersions.commonsBeanutils}", - curatorFramework: "org.apache.curator:curator-framework:${depVersions.curator}", - curatorRecipes: "org.apache.curator:curator-recipes:${depVersions.curator}", + curatorFramework: dependencies.create("org.apache.curator:curator-framework:${depVersions.curator}") { + exclude group: 'com.google.code.findbugs', module: 'jsr305' + exclude group: 'io.netty', module: 'netty-transport-native-epoll' + exclude group: 'log4j', module: 'log4j' + }, + + curatorRecipes: dependencies.create("org.apache.curator:curator-recipes:${depVersions.curator}") { + exclude group: 'org.apache.curator', module: 'curator-framework' + }, dockerJava: "com.github.docker-java:docker-java:${depVersions.dockerJava}", errorprone: "com.google.errorprone:error_prone_annotations:${depVersions.errorprone}", freebuilder: "org.inferred:freebuilder:${depVersions.freebuilder}", + googleHTTPClient: dependencies.create("com.google.http-client:google-http-client:${depVersions.googleHTTPClient}") { + exclude group: 'com.google.code.findbugs', module: 'jsr305' + exclude group: 'commons-codec', module: 'commons-codec' + exclude group: 'commons-logging', module: 'commons-logging' + exclude group: 'org.apache.httpcomponents', module: 'httpcore' + exclude group: 'org.apache.httpcomponents', module: 'httpclient' + }, gradleTooling: "org.gradle:gradle-tooling-api:${depVersions.gradleTooling}", - grpc: "io.grpc:grpc-all:${depVersions.grpc}", + grpc: dependencies.create("io.grpc:grpc-all:${depVersions.grpc}") { + exclude group: 'com.google.http-client', module: 'google-http-client' + exclude group: 'com.squareup.okhttp', module: 'okhttp' + exclude group: 'com.squareup.okio', module: 'okio' + exclude group: 'com.google.code.findbugs', module: 'jsr305' + exclude group: 'io.grpc', module: 'grpc-netty-shaded' + exclude group: 'io.grpc', module: 'grpc-okhttp' + exclude group: 'junit', module: 'junit' + exclude group: 'org.bouncycastle', module: 'bcpkix-jdk15on' + exclude group: 'org.codehaus.mojo', module: 'animal-sniffer-annotations' + }, groovy: "org.codehaus.groovy:groovy-all:${depVersions.groovy}", - guava: "com.google.guava:guava:${depVersions.guava}", + guava: dependencies.create("com.google.guava:guava:${depVersions.guava}"){ + exclude group: 'com.google.code.findbugs', module: 'jsr305' + }, hdrHistogram: "org.hdrhistogram:HdrHistogram:${depVersions.hdrhistogram}", hamcrest: "org.hamcrest:hamcrest-all:${depVersions.hamcrest}", - httpclient: "org.apache.httpcomponents:httpclient:${depVersions.httpclient}", + httpclient: dependencies.create("org.apache.httpcomponents:httpclient:${depVersions.httpclient}") { + exclude group: 'commons-codec', module: 'commons-codec' + exclude group: 'commons-logging', module: 'commons-logging' + }, 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}", + javaxServlet: "javax.servlet:javax.servlet-api:${depVersions.javaxServlet}", jcommander: "com.beust:jcommander:${depVersions.jcommander}", jctools: "org.jctools:jctools-core:${depVersions.jctools}", - jettyServlet: "org.eclipse.jetty:jetty-servlet:${depVersions.jetty}", + jettyServlet: dependencies.create("org.eclipse.jetty:jetty-servlet:${depVersions.jetty}") { + exclude group: 'javax.servlet', module: 'javax.servlet-api' + }, jmock: "org.jmock:jmock:${depVersions.jmock}", jmhCore: "org.openjdk.jmh:jmh-core:${depVersions.jmh}", jmhGeneratorAnnprocess: "org.openjdk.jmh:jmh-generator-annprocess:${depVersions.jmh}", @@ -140,7 +174,12 @@ depLibs = [ nettyHandler: "io.netty:netty-handler:${depVersions.netty}", nettyTcnativeBoringSsl: "io.netty:netty-tcnative-boringssl-static:${depVersions.nettyTcnativeBoringSsl}", nettyTransport: "io.netty:netty-transport:${depVersions.netty}", - nettyTransportNativeEpoll: "io.netty:netty-transport-native-epoll:${depVersions.netty}", + nettyTransportNativeEpoll: "io.netty:netty-transport-native-epoll:${depVersions.netty}:linux-x86_64", + nettyProxy: "io.netty:netty-handler-proxy:${depVersions.netty}", + nettyCodecHTTP: "io.netty:netty-codec-http:${depVersions.netty}", + nettyCodecHTTP2: "io.netty:netty-codec-http2:${depVersions.netty}", + nettyResolver: "io.netty:netty-resolver:${depVersions.netty}", + nettyResolverDNS: "io.netty:netty-resolver-dns:${depVersions.netty}", powermockJunit: "org.powermock:powermock-module-junit4:${depVersions.powermock}", powermockMockito: "org.powermock:powermock-api-mockito2:${depVersions.powermock}", prometheusSimpleClient: "io.prometheus:simpleclient:${depVersions.prometheus}", @@ -157,15 +196,34 @@ depLibs = [ shrinkwrapApi: "org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-api:${depVersions.shrinkwrap}", snappy: "org.xerial.snappy:snappy-java:${depVersions.snappy}", snakeyaml: "org.yaml:snakeyaml:${depVersions.snakeyaml}", - spotbugsAnnotations: "com.github.spotbugs:spotbugs-annotations:${depVersions.spotbugsAnnotations}", + spotbugsAnnotations: dependencies.create("com.github.spotbugs:spotbugs-annotations:${depVersions.spotbugsAnnotations}") { + exclude group: 'com.google.code.findbugs', module: 'jsr305' + }, thrift: dependencies.create("org.apache.thrift:libthrift:${depVersions.thrift}") { exclude group: 'org.apache.tomcat.embed', module: 'tomcat-embed-core' exclude group: 'javax.annotation', module: 'javax.annotation-api' + exclude group: 'org.apache.httpcomponents', module: 'httpclient' + exclude group: 'org.apache.httpcomponents', module: 'httpcore' + exclude group: 'org.slf4j', module: 'slf4j-api' }, testcontainers: "org.testcontainers:testcontainers:${depVersions.testcontainers}", - vertxCore: "io.vertx:vertx-core:${depVersions.vertx}", - vertxWeb: "io.vertx:vertx-web:${depVersions.vertx}", + vertxCore: dependencies.create("io.vertx:vertx-core:${depVersions.vertx}") { + exclude group: 'com.fasterxml.jackson.core', module: 'jackson-annotations' + exclude group: 'com.fasterxml.jackson.core', module: 'jackson-databind' + exclude group: 'com.fasterxml.jackson.core', module: 'jackson-core' + exclude group: 'io.netty' + }, + vertxWeb: dependencies.create("io.vertx:vertx-web:${depVersions.vertx}") { + exclude group: 'com.fasterxml.jackson.core', module: 'jackson-annotations' + exclude group: 'com.fasterxml.jackson.core', module: 'jackson-databind' + exclude group: 'com.fasterxml.jackson.core', module: 'jackson-core' + exclude group: 'io.netty' + }, yahooDatasketches: "com.yahoo.datasketches:sketches-core:${depVersions.yahooDatasketches}", - zookeeper: "org.apache.zookeeper:zookeeper:${depVersions.zookeeper}", + zookeeper: dependencies.create("org.apache.zookeeper:zookeeper:${depVersions.zookeeper}") { + exclude group: 'io.netty', module: 'netty-transport-native-epoll' + exclude group: 'log4j', module: 'log4j' + exclude group: 'org.slf4j', module: 'slf4j-log4j12' + }, zookeeperTest: "org.apache.zookeeper:zookeeper:${depVersions.zookeeper}:tests" ] diff --git a/dev/check-all-licenses-gradle b/dev/check-all-licenses-gradle new file mode 100755 index 00000000000..03eeb51c65b --- /dev/null +++ b/dev/check-all-licenses-gradle @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# +# 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. +# + +# Script to check licenses on a binary tarball. +# It extracts the list of bundled jars, the NOTICE, and the LICENSE +# files. It checked that every non-bk jar bundled is mentioned in the +# LICENSE file. It checked that all jar files mentioned in NOTICE and +# LICENSE are actually bundled. + +# all error fatal +set -e -x + +HERE=$(dirname $0) +BOOKKEEPER_DIST=$HERE/../bookkeeper-dist +$HERE/check-binary-license $BOOKKEEPER_DIST/server/build/distributions/bookkeeper-server-*.tar.gz +$HERE/check-binary-license $BOOKKEEPER_DIST/all/build/distributions/bookkeeper-all-*.tar.gz +$HERE/check-binary-license $BOOKKEEPER_DIST/bkctl/build/distributions/bkctl-*.tar.gz + diff --git a/dev/check-binary-license b/dev/check-binary-license index 9d26d6e5cb0..644be1d384d 100755 --- a/dev/check-binary-license +++ b/dev/check-binary-license @@ -43,7 +43,7 @@ LICENSEPATH=$(${TAR} -tf $TARBALL | awk '/^[^\/]*\/LICENSE/') LICENSE=$(${TAR} -O -xf $TARBALL "$LICENSEPATH") NOTICEPATH=$(${TAR} -tf $TARBALL | awk '/^[^\/]*\/NOTICE/') NOTICE=$(${TAR} -O -xf $TARBALL $NOTICEPATH) - +echo $LICENSEPATH LICENSEJARS=$(echo "$LICENSE" | sed -nE 's!.*lib/(.*\.jar).*!\1!gp') NOTICEJARS=$(echo "$NOTICE" | sed -nE 's!.*lib/(.*\.jar).*!\1!gp') @@ -70,6 +70,21 @@ for J in $JARS; do continue fi + echo $J | grep -q "bookkeeper-dist-server" + if [ $? == 0 ]; then + continue + fi + + echo $J | grep -q "bookkeeper-dist-all" + if [ $? == 0 ]; then + continue + fi + + echo $J | grep -q "bookkeeper-dist-bkctl" + if [ $? == 0 ]; then + continue + fi + echo "$LICENSE" | grep -q $J if [ $? != 0 ]; then echo $J unaccounted for in LICENSE diff --git a/microbenchmarks/build.gradle b/microbenchmarks/build.gradle index cbb210794e3..897cfb3b89b 100644 --- a/microbenchmarks/build.gradle +++ b/microbenchmarks/build.gradle @@ -21,12 +21,12 @@ plugins { } dependencies { - compileOnly project(":bookkeeper-common") - compileOnly project(":bookkeeper-server") - compileOnly project(":bookkeeper-stats-providers:codahale-metrics-provider") - compileOnly project(":bookkeeper-stats-providers:prometheus-metrics-provider") - compileOnly project(":bookkeeper-stats") - compileOnly project(":bookkeeper-proto") + implementation project(":bookkeeper-stats-providers:codahale-metrics-provider") + implementation project(":bookkeeper-stats-providers:prometheus-metrics-provider") + implementation project(":bookkeeper-common") + implementation project(":bookkeeper-server") + implementation project(":bookkeeper-stats") + implementation project(":bookkeeper-proto") compileOnly depLibs.metricsCore compileOnly depLibs.protobuf compileOnly depLibs.nettyBuffer diff --git a/stats/utils/build.gradle b/stats/utils/build.gradle index 39ff187fbf5..1c40b106e21 100644 --- a/stats/utils/build.gradle +++ b/stats/utils/build.gradle @@ -33,10 +33,9 @@ dependencies { implementation depLibs.jacksonAnnotations implementation depLibs.jcommander implementation depLibs.reflections - implementation depLibs.log4j12api + implementation depLibs.slf4j implementation depLibs.snakeyaml - testCompileOnly depLibs.lombok diff --git a/stream/api/build.gradle b/stream/api/build.gradle index ad9eaa577ac..85bb55e9d7c 100644 --- a/stream/api/build.gradle +++ b/stream/api/build.gradle @@ -21,7 +21,7 @@ dependencies { implementation project(':stream:common') implementation depLibs.guava - implementation depLibs.lombok + compileOnly depLibs.lombok implementation depLibs.nettyBuffer implementation depLibs.nettyCommon diff --git a/stream/clients/java/all/build.gradle b/stream/clients/java/all/build.gradle index 54c47ed00a4..183ce38ae6e 100644 --- a/stream/clients/java/all/build.gradle +++ b/stream/clients/java/all/build.gradle @@ -25,13 +25,15 @@ dependencies { implementation project(':stream:proto') implementation depLibs.grpc - implementation depLibs.lombok + runtimeOnly depLibs.googleHTTPClient + compileOnly depLibs.lombok implementation depLibs.slf4j testImplementation project(path: ':stream:clients:java:base', configuration: 'testArtifacts') testImplementation depLibs.mockito testImplementation depLibs.powermockJunit testImplementation depLibs.powermockMockito + testImplementation depLibs.lombok annotationProcessor depLibs.lombok } diff --git a/stream/clients/java/base/build.gradle b/stream/clients/java/base/build.gradle index f0251c352ca..0c1082b7503 100644 --- a/stream/clients/java/base/build.gradle +++ b/stream/clients/java/base/build.gradle @@ -23,13 +23,18 @@ dependencies { implementation project(':stream:proto') implementation depLibs.commonsLang2 - compileOnly depLibs.freebuilder + implementation depLibs.freebuilder + compileOnly depLibs.jsr305 implementation depLibs.grpc - implementation depLibs.lombok + runtimeOnly depLibs.googleHTTPClient + compileOnly depLibs.lombok implementation depLibs.slf4j testImplementation depLibs.mockito + testImplementation depLibs.freebuilder + testImplementation depLibs.junit + testImplementation depLibs.lombok annotationProcessor depLibs.freebuilder annotationProcessor depLibs.lombok } @@ -38,6 +43,10 @@ configurations { testCompile.exclude group:'io.grpc', module: 'grpc-netty-shaded' } +jar { + archiveBaseName = 'stream-storage-java-client-base' +} + publishing { publications { maven(MavenPublication) { diff --git a/stream/clients/java/kv/build.gradle b/stream/clients/java/kv/build.gradle index e268ae5bb1a..3df6167cd14 100644 --- a/stream/clients/java/kv/build.gradle +++ b/stream/clients/java/kv/build.gradle @@ -23,14 +23,16 @@ dependencies { implementation project(':stream:common') implementation project(':stream:proto') implementation depLibs.grpc + runtimeOnly depLibs.googleHTTPClient implementation depLibs.guava - implementation depLibs.lombok + compileOnly depLibs.lombok implementation depLibs.nettyBuffer implementation depLibs.protobuf implementation depLibs.slf4j - + compileOnly depLibs.jsr305 testImplementation project(path: ':stream:clients:java:base', configuration: 'testArtifacts') testImplementation depLibs.mockito - + testImplementation depLibs.junit + testImplementation depLibs.lombok annotationProcessor depLibs.lombok } diff --git a/stream/common/build.gradle b/stream/common/build.gradle index cbd0406bdef..dee551749a5 100644 --- a/stream/common/build.gradle +++ b/stream/common/build.gradle @@ -16,17 +16,26 @@ * specific language governing permissions and limitations * under the License. */ + +plugins { + id 'com.adarshr.test-logger' + id 'org.gradle.test-retry' +} + dependencies { implementation project(':bookkeeper-common') implementation project(':bookkeeper-stats') implementation depLibs.grpc + runtimeOnly depLibs.googleHTTPClient implementation depLibs.guava - implementation depLibs.jsr305 - implementation depLibs.lombok + compileOnly depLibs.jsr305 + compileOnly depLibs.lombok implementation depLibs.slf4j + testImplementation depLibs.junit testImplementation depLibs.mockito testImplementation project(':stream:tests-common') testImplementation project(path: ':bookkeeper-common', configuration: 'testArtifacts') + testImplementation depLibs.lombok annotationProcessor depLibs.lombok testAnnotationProcessor depLibs.lombok } @@ -42,3 +51,13 @@ publishing { } } } + +test { + retry { + maxFailures = 10 + maxRetries = 2 + } + + maxHeapSize = '2G' + forkEvery = 1 +} \ No newline at end of file diff --git a/stream/distributedlog/common/build.gradle b/stream/distributedlog/common/build.gradle index c2c285d886f..ed4f74e513e 100644 --- a/stream/distributedlog/common/build.gradle +++ b/stream/distributedlog/common/build.gradle @@ -16,6 +16,12 @@ * specific language governing permissions and limitations * under the License. */ + +plugins { + id 'com.adarshr.test-logger' + id 'org.gradle.test-retry' +} + dependencies { compileOnly depLibs.lombok @@ -25,7 +31,7 @@ dependencies { implementation depLibs.commonsConfiguration implementation depLibs.commonsLang3 implementation depLibs.guava - implementation depLibs.jsr305 + compileOnly depLibs.jsr305 implementation depLibs.lz4 implementation depLibs.nettyBuffer implementation depLibs.slf4j @@ -36,6 +42,10 @@ dependencies { annotationProcessor depLibs.lombok } +jar { + archiveBaseName = 'distributedlog-common' +} + publishing { publications { maven(MavenPublication) { @@ -44,3 +54,13 @@ publishing { } } } + +test { + retry { + maxFailures = 20 + maxRetries = 2 + } + + maxHeapSize = '2G' + forkEvery = 1 +} \ No newline at end of file diff --git a/stream/distributedlog/core/build.gradle b/stream/distributedlog/core/build.gradle index ca739376dec..a3ee41bd5c0 100644 --- a/stream/distributedlog/core/build.gradle +++ b/stream/distributedlog/core/build.gradle @@ -18,6 +18,8 @@ */ plugins { id 'java' + id 'com.adarshr.test-logger' + id 'org.gradle.test-retry' } dependencies { @@ -32,30 +34,36 @@ dependencies { implementation depLibs.commonsIO implementation depLibs.commonsLang3 implementation depLibs.guava - implementation depLibs.jsr305 - implementation depLibs.lombok + compileOnly depLibs.jsr305 + compileOnly depLibs.lombok implementation depLibs.nettyBuffer implementation depLibs.nettyTransportNativeEpoll implementation depLibs.slf4j implementation depLibs.thrift + runtimeOnly depLibs.httpclient implementation depLibs.zookeeper testRuntimeOnly depLibs.metricsCore testRuntimeOnly depLibs.snappy - testRuntimeOnly depLibs.commonsBeanutils - testImplementation project(path: ':bookkeeper-common', configuration: 'testArtifacts') testImplementation project(path: ':stream:distributedlog:common', configuration: 'testArtifacts') testImplementation depLibs.junit testImplementation depLibs.mockito - implementation depLibs.javaAnnotations + testImplementation depLibs.lombok + testCompileOnly depLibs.jsr305 + compileOnly depLibs.javaAnnotations annotationProcessor depLibs.lombok testAnnotationProcessor depLibs.lombok } test { + retry { + maxFailures = 20 + maxRetries = 2 + } + maxHeapSize = '4G' forkEvery = 1 } @@ -65,6 +73,10 @@ test.doFirst { "-Djava.net.preferIPv4Stack=true", "-Dio.netty.leakDetection.level=paranoid") } +jar { + archiveBaseName = 'distributedlog-core' +} + publishing { publications { maven(MavenPublication) { diff --git a/stream/distributedlog/protocol/build.gradle b/stream/distributedlog/protocol/build.gradle index 7e93bb300a7..532d41fb8af 100644 --- a/stream/distributedlog/protocol/build.gradle +++ b/stream/distributedlog/protocol/build.gradle @@ -16,21 +16,31 @@ * specific language governing permissions and limitations * under the License. */ + +plugins { + id 'com.adarshr.test-logger' + id 'org.gradle.test-retry' +} + dependencies { implementation project(':stream:distributedlog:common') implementation depLibs.commonsCodec implementation depLibs.guava - implementation depLibs.jsr305 - implementation depLibs.lombok + compileOnly depLibs.jsr305 + compileOnly depLibs.lombok implementation depLibs.nettyBuffer implementation depLibs.slf4j testImplementation project(':bookkeeper-common') testImplementation depLibs.junit - + testImplementation depLibs.lombok annotationProcessor depLibs.lombok } +jar { + archiveBaseName = 'distributedlog-protocol' +} + publishing { publications { maven(MavenPublication) { @@ -39,3 +49,13 @@ publishing { } } } + +test { + retry { + maxFailures = 20 + maxRetries = 3 + } + + maxHeapSize = '2G' + forkEvery = 1 +} \ No newline at end of file diff --git a/stream/proto/build.gradle b/stream/proto/build.gradle index cc27288f437..d492592b4a1 100644 --- a/stream/proto/build.gradle +++ b/stream/proto/build.gradle @@ -18,15 +18,18 @@ */ plugins { id 'com.google.protobuf' + id 'com.adarshr.test-logger' } dependencies { implementation project(':stream:common') - implementation depLibs.lombok + compileOnly depLibs.lombok implementation depLibs.grpc + runtimeOnly depLibs.googleHTTPClient implementation depLibs.commonsLang3 - implementation depLibs.javaAnnotations - + compileOnly depLibs.jsr305 + testImplementation depLibs.junit + compileOnly depLibs.javaAnnotations annotationProcessor depLibs.lombok } @@ -48,6 +51,10 @@ protobuf { } } +jar { + archiveBaseName = 'stream-storage-proto' +} + publishing { publications { maven(MavenPublication) { diff --git a/stream/server/build.gradle b/stream/server/build.gradle index 76f966abc2d..944277dcd3c 100644 --- a/stream/server/build.gradle +++ b/stream/server/build.gradle @@ -19,6 +19,13 @@ plugins { id 'application' id 'distribution' + id 'com.adarshr.test-logger' +} + +configurations { + runtimeClasspath { + resolutionStrategy.force depLibs.jacksonAnnotations + } } dependencies { @@ -44,18 +51,19 @@ dependencies { implementation depLibs.commonsLang3 implementation depLibs.curatorFramework implementation depLibs.grpc + runtimeOnly depLibs.googleHTTPClient implementation depLibs.guava implementation depLibs.jcommander - implementation depLibs.lombok + compileOnly depLibs.lombok implementation depLibs.zookeeper - runtimeOnly depLibs.metricsCore - runtimeOnly depLibs.snappy - runtimeOnly depLibs.log4j12api - runtimeOnly depLibs.commonsBeanutils - runtimeOnly depLibs.vertxCore - runtimeOnly depLibs.vertxWeb + implementation depLibs.metricsCore + implementation depLibs.snappy + implementation depLibs.log4j12api + implementation depLibs.vertxCore + implementation depLibs.vertxWeb testImplementation depLibs.mockito - implementation depLibs.javaAnnotations + testImplementation depLibs.junit + compileOnly depLibs.javaAnnotations annotationProcessor depLibs.lombok } @@ -69,6 +77,10 @@ task writeClasspath { new File(buildDir, "classpath.txt").text = sourceSets.main.runtimeClasspath.collect { it.absolutePath }.join(':') + "\n" } +jar { + archiveBaseName = 'stream-storage-server' +} + publishing { publications { maven(MavenPublication) { diff --git a/stream/statelib/build.gradle b/stream/statelib/build.gradle index d2d98321f78..21941e1613d 100644 --- a/stream/statelib/build.gradle +++ b/stream/statelib/build.gradle @@ -18,6 +18,8 @@ */ plugins { id 'com.google.protobuf' + id 'com.adarshr.test-logger' + id 'org.gradle.test-retry' } dependencies { @@ -32,8 +34,8 @@ dependencies { implementation depLibs.commonsLang2 implementation depLibs.commonsLang3 implementation depLibs.guava - implementation depLibs.jsr305 - implementation depLibs.lombok + compileOnly depLibs.jsr305 + compileOnly depLibs.lombok implementation depLibs.nettyBuffer implementation depLibs.nettyCommon implementation depLibs.protobuf @@ -47,7 +49,8 @@ dependencies { testImplementation depLibs.metricsCore testImplementation depLibs.snappy testImplementation depLibs.slf4jSimple - runtimeOnly depLibs.commonsBeanutils + testImplementation depLibs.lombok + //runtimeOnly depLibs.commonsBeanutils testImplementation project(path: ':stream:distributedlog:core', configuration: 'testArtifacts') annotationProcessor depLibs.lombok @@ -73,6 +76,11 @@ protobuf { } test { + retry { + maxFailures = 200 + maxRetries = 5 + } + maxHeapSize = '2G' forkEvery = 1 } diff --git a/stream/storage/api/build.gradle b/stream/storage/api/build.gradle index b4ff1ff0eaf..24d41afbc57 100644 --- a/stream/storage/api/build.gradle +++ b/stream/storage/api/build.gradle @@ -16,12 +16,19 @@ * specific language governing permissions and limitations * under the License. */ +plugins { + id 'java' + id 'com.adarshr.test-logger' +} + dependencies { implementation project(':bookkeeper-common') implementation project(':stream:common') implementation project(':stream:proto') implementation depLibs.commonsConfiguration implementation depLibs.grpc + runtimeOnly depLibs.googleHTTPClient + testImplementation depLibs.junit } jar { diff --git a/stream/storage/impl/build.gradle b/stream/storage/impl/build.gradle index 231abe2e9ab..0e00a3e5b80 100644 --- a/stream/storage/impl/build.gradle +++ b/stream/storage/impl/build.gradle @@ -16,6 +16,12 @@ * specific language governing permissions and limitations * under the License. */ + +plugins { + id 'java' + id 'com.adarshr.test-logger' +} + dependencies { implementation project(':bookkeeper-common') implementation project(':bookkeeper-server') @@ -32,22 +38,31 @@ dependencies { implementation depLibs.commonsConfiguration implementation depLibs.commonsLang3 implementation depLibs.curatorRecipes + implementation depLibs.curatorFramework implementation depLibs.grpc + runtimeOnly depLibs.googleHTTPClient implementation depLibs.guava - implementation depLibs.lombok + compileOnly depLibs.lombok implementation depLibs.slf4j - + compileOnly depLibs.jsr305 testImplementation project(':stream:distributedlog:common') testImplementation project(':stream:distributedlog:protocol') testImplementation project(path: ':bookkeeper-common', configuration: 'testArtifacts') testImplementation project(path: ':stream:clients:java:base', configuration: 'testArtifacts') testImplementation project(path: ':stream:distributedlog:core', configuration: 'testArtifacts') testImplementation depLibs.mockito - + testImplementation depLibs.junit + testImplementation depLibs.lombok + testImplementation depLibs.metricsCore + testImplementation depLibs.snappy annotationProcessor depLibs.lombok testAnnotationProcessor depLibs.lombok } +jar { + archiveBaseName = 'stream-storage-service-impl' +} + publishing { publications { maven(MavenPublication) { diff --git a/stream/tests-common/build.gradle b/stream/tests-common/build.gradle index 5259cd6e0e9..5de37a758fc 100644 --- a/stream/tests-common/build.gradle +++ b/stream/tests-common/build.gradle @@ -22,11 +22,12 @@ plugins { dependencies { implementation depLibs.grpc - implementation depLibs.lombok + testImplementation depLibs.googleHTTPClient + compileOnly depLibs.lombok implementation depLibs.slf4j - + compileOnly depLibs.jsr305 annotationProcessor depLibs.lombok - implementation depLibs.javaAnnotations + compileOnly depLibs.javaAnnotations } protobuf { diff --git a/tests/docker-images/statestore-image/Dockerfile b/tests/docker-images/statestore-image/Dockerfile index 15cfa9c4618..0c8098a49f6 100644 --- a/tests/docker-images/statestore-image/Dockerfile +++ b/tests/docker-images/statestore-image/Dockerfile @@ -46,7 +46,7 @@ RUN mkdir /opt/bookkeeper/conf RUN mkdir /opt/bookkeeper/scripts ### -----Copy Jars------### -ADD ./dist/server.tar /opt/ +ADD ./dist/server.tar.gz /opt/ RUN mv /opt/server/lib/*.jar /opt/bookkeeper/lib/ ### --------------------### diff --git a/tests/docker-images/statestore-image/image_builder.sh b/tests/docker-images/statestore-image/image_builder.sh index 91513bc3f5c..6cc6cde1c46 100755 --- a/tests/docker-images/statestore-image/image_builder.sh +++ b/tests/docker-images/statestore-image/image_builder.sh @@ -27,7 +27,7 @@ mkdir "${BASE_DIR}"/tests/docker-images/statestore-image/scripts mkdir "${BASE_DIR}"/tests/docker-images/statestore-image/temp_conf mkdir "${BASE_DIR}"/tests/docker-images/statestore-image/temp_bin -cp "${BASE_DIR}"/stream/server/build/distributions/server.tar "${BASE_DIR}"/tests/docker-images/statestore-image/dist +cp "${BASE_DIR}"/stream/server/build/distributions/server.tar.gz "${BASE_DIR}"/tests/docker-images/statestore-image/dist cp "${BASE_DIR}"/docker/scripts/* "${BASE_DIR}"/tests/docker-images/statestore-image/scripts cp "${BASE_DIR}"/conf/* "${BASE_DIR}"/tests/docker-images/statestore-image/temp_conf cp "${BASE_DIR}"/bin/* "${BASE_DIR}"/tests/docker-images/statestore-image/temp_bin diff --git a/tests/integration-tests-topologies/build.gradle b/tests/integration-tests-topologies/build.gradle index a97b03484d2..f26f6903965 100644 --- a/tests/integration-tests-topologies/build.gradle +++ b/tests/integration-tests-topologies/build.gradle @@ -20,7 +20,7 @@ dependencies { implementation project(':tests:integration-tests-utils') implementation depLibs.testcontainers implementation depLibs.junit - implementation depLibs.lombok + compileOnly depLibs.lombok implementation depLibs.slf4j implementation depLibs.guava implementation depLibs.commonsLang2 diff --git a/tests/integration-tests-utils/build.gradle b/tests/integration-tests-utils/build.gradle index 9940ff92925..649421eeef0 100644 --- a/tests/integration-tests-utils/build.gradle +++ b/tests/integration-tests-utils/build.gradle @@ -20,7 +20,7 @@ dependencies { implementation depLibs.arquillianCubeDocker implementation depLibs.zookeeper implementation depLibs.junit - implementation depLibs.lombok + compileOnly depLibs.lombok implementation depLibs.slf4j implementation depLibs.groovy implementation depLibs.shrinkwrapImpl diff --git a/tests/integration/cluster/build.gradle b/tests/integration/cluster/build.gradle index 16e8fe6855f..4eafefd1b97 100644 --- a/tests/integration/cluster/build.gradle +++ b/tests/integration/cluster/build.gradle @@ -18,7 +18,7 @@ */ plugins { id 'java' - id 'com.adarshr.test-logger' version '2.0.0' + id 'com.adarshr.test-logger' } dependencies { @@ -40,6 +40,7 @@ dependencies { testImplementation depLibs.log4j12api testImplementation depLibs.testcontainers testImplementation depLibs.commonsConfiguration + testImplementation depLibs.googleHTTPClient testAnnotationProcessor depLibs.lombok } diff --git a/tests/integration/smoke/build.gradle b/tests/integration/smoke/build.gradle index bf6a938c8a2..02ad13b25fb 100644 --- a/tests/integration/smoke/build.gradle +++ b/tests/integration/smoke/build.gradle @@ -18,7 +18,7 @@ */ plugins { id 'java' - id 'com.adarshr.test-logger' version '2.0.0' + id 'com.adarshr.test-logger' } dependencies { diff --git a/tests/integration/standalone/build.gradle b/tests/integration/standalone/build.gradle index f8f0751a56f..17044f7bce6 100644 --- a/tests/integration/standalone/build.gradle +++ b/tests/integration/standalone/build.gradle @@ -18,7 +18,7 @@ */ plugins { id 'java' - id 'com.adarshr.test-logger' version '2.0.0' + id 'com.adarshr.test-logger' } dependencies { diff --git a/tools/all/build.gradle b/tools/all/build.gradle index 5b667eb3c06..d70ec09f56c 100644 --- a/tools/all/build.gradle +++ b/tools/all/build.gradle @@ -26,7 +26,8 @@ dependencies { implementation project(':bookkeeper-tools-ledger') implementation project(':bookkeeper-tools-stream') - + // implementation depLibs.nettyCodecHTTP2 + //implementation depLibs.nettyCodecHTTP compileOnly depLibs.lombok compileOnly depLibs.spotbugsAnnotations diff --git a/tools/framework/build.gradle b/tools/framework/build.gradle index c188a1cb287..ddf9c468f9d 100644 --- a/tools/framework/build.gradle +++ b/tools/framework/build.gradle @@ -29,10 +29,17 @@ dependencies { implementation depLibs.jcommander implementation depLibs.slf4j testImplementation depLibs.junit - annotationProcessor depLibs.lombok } jar { archiveBaseName = 'bookkeeper-tools-framework' +} + +publishing { + publications { + maven(MavenPublication) { + artifactId = 'bookkeeper-tools-framework' + } + } } \ No newline at end of file diff --git a/tools/ledger/build.gradle b/tools/ledger/build.gradle index 23334dd3bea..149f36e2647 100644 --- a/tools/ledger/build.gradle +++ b/tools/ledger/build.gradle @@ -18,6 +18,7 @@ */ plugins { id 'java' + id 'com.adarshr.test-logger' } dependencies { @@ -33,7 +34,9 @@ dependencies { implementation depLibs.jcommander implementation depLibs.slf4j implementation depLibs.zookeeper - + implementation depLibs.nettyCodecHTTP2 + implementation depLibs.nettyCodecHTTP + implementation depLibs.nettyProxy testImplementation project(":bookkeeper-stats") testCompileOnly depLibs.lombok testImplementation depLibs.junit diff --git a/tools/ledger/src/test/java/org/apache/bookkeeper/tools/cli/helpers/CookieCommandTestBase.java b/tools/ledger/src/test/java/org/apache/bookkeeper/tools/cli/helpers/CookieCommandTestBase.java index f6f66b6e2fa..45d7d8b6ab2 100644 --- a/tools/ledger/src/test/java/org/apache/bookkeeper/tools/cli/helpers/CookieCommandTestBase.java +++ b/tools/ledger/src/test/java/org/apache/bookkeeper/tools/cli/helpers/CookieCommandTestBase.java @@ -22,21 +22,17 @@ import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; - import java.util.function.Function; import org.apache.bookkeeper.conf.ServerConfiguration; import org.apache.bookkeeper.discover.RegistrationManager; import org.apache.bookkeeper.meta.MetadataDrivers; import org.junit.Before; -import org.junit.runner.RunWith; import org.powermock.api.mockito.PowerMockito; import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.modules.junit4.PowerMockRunner; /** * A test base for testing cookie commands. */ -@RunWith(PowerMockRunner.class) @PrepareForTest({ MetadataDrivers.class }) public class CookieCommandTestBase extends CommandTestBase { diff --git a/tools/perf/build.gradle b/tools/perf/build.gradle index b7d659e6853..71c5c83ef95 100644 --- a/tools/perf/build.gradle +++ b/tools/perf/build.gradle @@ -18,6 +18,7 @@ */ plugins { id 'java' + id 'com.adarshr.test-logger' } dependencies { @@ -46,6 +47,7 @@ dependencies { implementation depLibs.log4j12api implementation depLibs.zookeeper implementation depLibs.curatorFramework + //implementation depLibs.curatorClient implementation depLibs.protobuf implementation depLibs.jacksonDatabind implementation depLibs.hdrHistogram diff --git a/tools/stream/build.gradle b/tools/stream/build.gradle index 223f27ed4dc..1a379216554 100644 --- a/tools/stream/build.gradle +++ b/tools/stream/build.gradle @@ -18,6 +18,7 @@ */ plugins { id 'java' + id 'com.adarshr.test-logger' } dependencies { @@ -53,3 +54,11 @@ dependencies { jar { archiveBaseName = 'stream-storage-cli' } + +publishing { + publications { + maven(MavenPublication) { + artifactId = 'stream-storage-cli' + } + } +} \ No newline at end of file