diff --git a/ache-tools/build.gradle b/ache-tools/build.gradle index 58797cfc6..46867f71b 100644 --- a/ache-tools/build.gradle +++ b/ache-tools/build.gradle @@ -6,18 +6,14 @@ plugins { mainClassName = 'achecrawler.RunCliTool' applicationDefaultJvmArgs = ["-Dname=ache-tools -XX:+HeapDumpOnOutOfMemoryError"] -repositories { - mavenCentral() -} - dependencies { // Sub-projects implementation project(':ache') implementation project(':crawler-commons') // Dependencies - implementation group: 'org.slf4j', name: 'slf4j-api', version: '1.7.+' - implementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.4.+' + implementation libraries.slf4j_api + implementation libraries.logback implementation group: 'org.apache.commons', name: 'commons-compress', version: '1.21' implementation group: 'commons-validator', name: 'commons-validator', version: '1.6' implementation group: 'io.airlift', name: 'airline', version: '0.9' @@ -30,12 +26,8 @@ dependencies { implementation group: 'com.amazonaws', name: 'aws-java-sdk-s3', version: '1.12.+' // Test framework dependencies - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.2' - testImplementation 'org.junit.jupiter:junit-jupiter-params:5.9.2' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.2' - testImplementation group: 'org.assertj', name: 'assertj-core', version: '3.24.2' -} - -test { - useJUnitPlatform() -} + testImplementation libraries.junit_jupiter_api + testImplementation libraries.junit_jupiter_params + testRuntimeOnly libraries.junit_jupiter_engine + testImplementation libraries.assertj_core +} \ No newline at end of file diff --git a/ache/build.gradle b/ache/build.gradle index 338b498b5..a5fa27761 100644 --- a/ache/build.gradle +++ b/ache/build.gradle @@ -6,23 +6,22 @@ plugins { id 'com.github.kt3k.coveralls' version '2.12.0' } -sourceCompatibility = 1.8 -targetCompatibility = 1.8 compileJava.options.encoding = "UTF-8" version = '0.15.0-SNAPSHOT' mainClassName = 'achecrawler.Main' applicationDefaultJvmArgs = ["-Dname=ache -XX:+UseConcMarkSweepGC -XX:+HeapDumpOnOutOfMemoryError"] -repositories { - mavenCentral() -} +ext.versions = [ + com_fasterxml_jackson: '2.14.2', + io_dropwizard_metrics: '4.2.17', +] dependencies { // Sub-projects implementation project(':crawler-commons') // Logging - implementation group: 'org.slf4j', name: 'slf4j-api', version: '1.7.36' - implementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.4.5' + implementation libraries.slf4j_api + implementation libraries.logback // Commons implementation group: 'com.google.guava', name: 'guava', version: '23.0' implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' @@ -33,17 +32,17 @@ dependencies { // CLI implementation group: 'io.airlift', name: 'airline', version: '0.9' // Data serialization - implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.14.2' - implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-cbor', version: '2.14.2' - implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: '2.14.2' + implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: versions.com_fasterxml_jackson + implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-cbor', version: versions.com_fasterxml_jackson + implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: versions.com_fasterxml_jackson implementation group: 'com.esotericsoftware', name: 'kryo', version: '4.0.2' implementation group: 'de.javakaffee', name: 'kryo-serializers', version: '0.43' // REST server dependencies implementation group: 'io.javalin', name: 'javalin', version: '4.2.0' // Metrics and monitoring - implementation group: 'io.dropwizard.metrics', name: 'metrics-core', version: '4.2.17' - implementation group: 'io.dropwizard.metrics', name: 'metrics-json', version: '4.2.17' - implementation group: 'io.dropwizard.metrics', name: 'metrics-jvm', version: '4.2.17' + implementation group: 'io.dropwizard.metrics', name: 'metrics-core', version: versions.io_dropwizard_metrics + implementation group: 'io.dropwizard.metrics', name: 'metrics-json', version: versions.io_dropwizard_metrics + implementation group: 'io.dropwizard.metrics', name: 'metrics-jvm', version: versions.io_dropwizard_metrics // Data management and repositories implementation group: 'org.rocksdb', name: 'rocksdbjni', version: '6.25.3' implementation group: 'org.elasticsearch.client', name: 'elasticsearch-rest-client', version: '5.6.7' @@ -68,15 +67,11 @@ dependencies { implementation files('libs/jsonic-1.2.0.jar') // required by by langdetect-03-03-2014.jar // Test framework dependencies - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.2' - testImplementation 'org.junit.jupiter:junit-jupiter-params:5.9.2' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.2' - testImplementation group: 'org.assertj', name: 'assertj-core', version: '3.24.2' - testImplementation group: 'org.mockito', name: 'mockito-core', version: '5.1.1' -} - -test { - useJUnitPlatform() + testImplementation libraries.junit_jupiter_api + testImplementation libraries.junit_jupiter_params + testRuntimeOnly libraries.junit_jupiter_engine + testImplementation libraries.mockito + testImplementation libraries.assertj_core } // diff --git a/build.gradle b/build.gradle index fe09823cf..1ba973b42 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,29 @@ plugins { id 'java' } -repositories { - mavenCentral() -} +subprojects { + + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + repositories { + mavenCentral() + } + test { + useJUnitPlatform() + } + + // Dependencies used by multiple sub-projects + ext.libraries = [ + // testing + junit_jupiter_api: [group: "org.junit.jupiter", name: "junit-jupiter-api", version: "5.9.2"], + junit_jupiter_params: [group: "org.junit.jupiter", name: "junit-jupiter-params", version: "5.9.2"], + junit_jupiter_engine: [group: "org.junit.jupiter", name: "junit-jupiter-engine", version: "5.9.2"], + assertj_core: [group: "org.assertj", name: "assertj-core", version: "3.20.2"], + mockito: [group: "org.mockito", name: "mockito-core", version: "5.1.1"], + // logging + slf4j_api: [group: 'org.slf4j', name: 'slf4j-api', version: '2.0.6'], + logback: [group: 'ch.qos.logback', name: 'logback-classic', version: '1.4.5'], + ] +}