diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle new file mode 100644 index 0000000000..c882e03029 --- /dev/null +++ b/buildSrc/build.gradle @@ -0,0 +1,12 @@ +apply plugin: 'groovy' +apply plugin: 'java' + + +repositories { + mavenCentral() +} + +dependencies { + implementation gradleApi() + implementation localGroovy() +} \ No newline at end of file diff --git a/common/build.gradle b/common/build.gradle index 3f23b5cd31..f7143a30ac 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -23,7 +23,7 @@ */ plugins { - id 'java' + id 'java-library' id "io.freefair.lombok" } @@ -32,9 +32,9 @@ repositories { } dependencies { - compile "org.antlr:antlr4-runtime:4.7.1" - compile group: 'com.google.guava', name: 'guava', version: '31.0.1-jre' - compile group: 'org.apache.logging.log4j', name: 'log4j-core', version:'2.17.1' + api "org.antlr:antlr4-runtime:4.7.1" + api group: 'com.google.guava', name: 'guava', version: '31.0.1-jre' + api group: 'org.apache.logging.log4j', name: 'log4j-core', version:'2.17.1' - testCompile group: 'junit', name: 'junit', version: '4.13.2' + testImplementation group: 'junit', name: 'junit', version: '4.13.2' } diff --git a/core/build.gradle b/core/build.gradle index 5ced00381a..f191032016 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -23,7 +23,7 @@ */ plugins { - id 'java' + id 'java-library' id "io.freefair.lombok" id 'jacoco' } @@ -39,19 +39,19 @@ repositories { //} dependencies { - compile group: 'com.google.guava', name: 'guava', version: '31.0.1-jre' - compile group: 'org.springframework', name: 'spring-context', version: "${spring_version}" - compile group: 'org.springframework', name: 'spring-beans', version: "${spring_version}" - compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.10' - compile group: 'com.facebook.presto', name: 'presto-matching', version: '0.240' - compile group: 'org.apache.commons', name: 'commons-math3', version: '3.6.1' - compile project(':common') + api group: 'com.google.guava', name: 'guava', version: '31.0.1-jre' + api group: 'org.springframework', name: 'spring-context', version: "${spring_version}" + api group: 'org.springframework', name: 'spring-beans', version: "${spring_version}" + api group: 'org.apache.commons', name: 'commons-lang3', version: '3.10' + api group: 'com.facebook.presto', name: 'presto-matching', version: '0.240' + api group: 'org.apache.commons', name: 'commons-math3', version: '3.6.1' + api project(':common') testImplementation('org.junit.jupiter:junit-jupiter:5.6.2') - testCompile group: 'org.hamcrest', name: 'hamcrest-library', version: '2.1' - testCompile group: 'org.springframework', name: 'spring-test', version: "${spring_version}" - testCompile group: 'org.mockito', name: 'mockito-core', version: '3.3.3' - testCompile group: 'org.mockito', name: 'mockito-junit-jupiter', version: '3.3.3' + testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: '2.1' + testImplementation group: 'org.springframework', name: 'spring-test', version: "${spring_version}" + testImplementation group: 'org.mockito', name: 'mockito-core', version: '3.3.3' + testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '3.3.3' } test { diff --git a/doctest/build.gradle b/doctest/build.gradle index d889287bef..5dba958b9d 100644 --- a/doctest/build.gradle +++ b/doctest/build.gradle @@ -7,8 +7,8 @@ import java.util.concurrent.Callable import org.opensearch.gradle.testclusters.RunTask plugins { - id "com.wiredforcode.spawn" version "0.8.2" id 'base' + id 'com.wiredforcode.spawn' } apply plugin: 'opensearch.testclusters' diff --git a/integ-test/build.gradle b/integ-test/build.gradle index 3a828d8677..80eab11d93 100644 --- a/integ-test/build.gradle +++ b/integ-test/build.gradle @@ -55,30 +55,31 @@ configurations.all { } dependencies { - testCompile group: 'org.opensearch.test', name: 'framework', version: "${opensearch_version}" - testCompile group: 'org.opensearch.client', name: 'opensearch-rest-high-level-client', version: "${opensearch_version}" - testCompile group: 'org.opensearch.client', name: 'opensearch-rest-client', version: "${opensearch_version}" - testCompile group: 'org.hamcrest', name: 'hamcrest', version: '2.1' - testCompile group: 'org.apache.logging.log4j', name: 'log4j-core', version:'2.17.1' - testCompile project(':plugin') - testCompile project(':legacy') + testImplementation group: 'org.opensearch.test', name: 'framework', version: "${opensearch_version}" + testImplementation group: 'org.opensearch.client', name: 'opensearch-rest-high-level-client', version: "${opensearch_version}" + testImplementation group: 'org.opensearch.client', name: 'opensearch-rest-client', version: "${opensearch_version}" + testImplementation group: 'org.hamcrest', name: 'hamcrest', version: '2.1' + implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version:'2.17.1' + testImplementation project(':plugin') + testImplementation project(':legacy') testImplementation('org.junit.jupiter:junit-jupiter-api:5.6.2') testRuntimeOnly('org.junit.jupiter:junit-jupiter-engine:5.6.2') // JDBC drivers for comparison test. Somehow Apache Derby throws security permission exception. - testCompile fileTree('../sql-jdbc/build/libs') { + testImplementation fileTree('../sql-jdbc/build/libs') { include '*.jar' builtBy 'compileJdbc' } - testCompile group: 'com.h2database', name: 'h2', version: '2.1.210' - testCompile group: 'org.xerial', name: 'sqlite-jdbc', version: '3.28.0' - testCompile group: 'com.google.code.gson', name: 'gson', version: '2.8.9' + testImplementation group: 'com.h2database', name: 'h2', version: '2.1.210' + testImplementation group: 'org.xerial', name: 'sqlite-jdbc', version: '3.28.0' + testImplementation group: 'com.google.code.gson', name: 'gson', version: '2.8.9' } dependencyLicenses.enabled = false testingConventions.enabled = false checkstyleTest.ignoreFailures = true forbiddenApisTest.enabled = false +thirdPartyAudit.enabled = false compileTestJava { options.compilerArgs.addAll(["-processor", 'lombok.launch.AnnotationProcessorHider$AnnotationProcessor']) @@ -141,27 +142,6 @@ integTest { } -task docTest(type: RestIntegTestTask) { - dependsOn ':plugin:bundlePlugin' - - systemProperty 'tests.security.manager', 'false' - systemProperty('project.root', project.projectDir.absolutePath) - - // Tell the test JVM if the cluster JVM is running under a debugger so that tests can use longer timeouts for - // requests. The 'doFirst' delays reading the debug setting on the cluster till execution time. - doFirst { systemProperty 'cluster.debug', getDebug() } - - if (System.getProperty("test.debug") != null) { - jvmArgs '-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:5005' - } - - include 'org/opensearch/sql/doctest/**/*IT.class' - exclude 'org/opensearch/sql/correctness/**/*IT.class' - exclude 'org/opensearch/sql/ppl/**/*IT.class' - exclude 'org/opensearch/sql/sql/**/*IT.class' - exclude 'org/opensearch/sql/legacy/**/*IT.class' -} - task comparisonTest(type: RestIntegTestTask) { dependsOn ':plugin:bundlePlugin' diff --git a/legacy/build.gradle b/legacy/build.gradle index 06c694f25d..8cd146ff1c 100644 --- a/legacy/build.gradle +++ b/legacy/build.gradle @@ -79,31 +79,31 @@ test { } dependencies { - compile group: 'com.alibaba', name: 'druid', version:'1.0.15' - compile group: 'org.locationtech.spatial4j', name: 'spatial4j', version:'0.7' - compile group: "org.opensearch.plugin", name: 'parent-join-client', version: "${opensearch_version}" - compile group: "org.opensearch.plugin", name: 'reindex-client', version: "${opensearch_version}" + implementation group: 'com.alibaba', name: 'druid', version:'1.0.15' + implementation group: 'org.locationtech.spatial4j', name: 'spatial4j', version:'0.7' + implementation group: "org.opensearch.plugin", name: 'parent-join-client', version: "${opensearch_version}" + implementation group: "org.opensearch.plugin", name: 'reindex-client', version: "${opensearch_version}" constraints { implementation('commons-codec:commons-codec:1.13') { because 'https://www.whitesourcesoftware.com/vulnerability-database/WS-2019-0379' } } implementation group: 'com.google.guava', name: 'guava', version: '31.0.1-jre' - compile group: 'org.json', name: 'json', version:'20180813' - compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.10' - compile group: 'org.opensearch', name: 'opensearch', version: "${opensearch_version}" - compile project(':sql') - compile project(':common') - compile project(':opensearch') + implementation group: 'org.json', name: 'json', version:'20180813' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.10' + implementation group: 'org.opensearch', name: 'opensearch', version: "${opensearch_version}" + api project(':sql') + api project(':common') + api project(':opensearch') // ANTLR gradle plugin and runtime dependency antlr "org.antlr:antlr4:4.7.1" - compile "org.antlr:antlr4-runtime:4.7.1" + implementation "org.antlr:antlr4-runtime:4.7.1" compileOnly group: 'javax.servlet', name: 'servlet-api', version:'2.5' - testCompile group: 'org.hamcrest', name: 'hamcrest-core', version:'2.2' - testCompile group: 'org.mockito', name: 'mockito-inline', version:'3.5.0' - testCompile group: 'junit', name: 'junit', version: '4.13.2' - testCompile group: "org.opensearch.client", name: 'transport', version: "${opensearch_version}" + testImplementation group: 'org.hamcrest', name: 'hamcrest-core', version:'2.2' + testImplementation group: 'org.mockito', name: 'mockito-inline', version:'3.5.0' + testImplementation group: 'junit', name: 'junit', version: '4.13.2' + testImplementation group: "org.opensearch.client", name: 'transport', version: "${opensearch_version}" } diff --git a/opensearch/build.gradle b/opensearch/build.gradle index 88019a0542..2c4a13928e 100644 --- a/opensearch/build.gradle +++ b/opensearch/build.gradle @@ -23,28 +23,28 @@ */ plugins { - id 'java' + id 'java-library' id "io.freefair.lombok" id 'jacoco' } dependencies { - compile project(':core') - compile group: 'org.opensearch', name: 'opensearch', version: "${opensearch_version}" - compile "io.github.resilience4j:resilience4j-retry:1.5.0" - compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: "${jackson_version}" - compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: "${jackson_databind_version}" - compile group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-cbor', version: "${jackson_version}" - compile group: 'org.json', name: 'json', version:'20180813' + api project(':core') + api group: 'org.opensearch', name: 'opensearch', version: "${opensearch_version}" + implementation "io.github.resilience4j:resilience4j-retry:1.5.0" + implementation group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: "${jackson_version}" + implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: "${jackson_databind_version}" + implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-cbor', version: "${jackson_version}" + implementation group: 'org.json', name: 'json', version:'20180813' compileOnly group: 'org.opensearch.client', name: 'opensearch-rest-high-level-client', version: "${opensearch_version}" - compile group: 'org.opensearch', name:'opensearch-ml-client', version: '1.3.4.0-SNAPSHOT' + implementation group: 'org.opensearch', name:'opensearch-ml-client', version: '1.3.0.0-SNAPSHOT' testImplementation('org.junit.jupiter:junit-jupiter:5.6.2') - testCompile group: 'org.hamcrest', name: 'hamcrest-library', version: '2.1' - testCompile group: 'org.mockito', name: 'mockito-core', version: '3.5.0' - testCompile group: 'org.mockito', name: 'mockito-junit-jupiter', version: '3.5.0' - testCompile group: 'org.opensearch.client', name: 'opensearch-rest-high-level-client', version: "${opensearch_version}" - testCompile group: 'org.opensearch.test', name: 'framework', version: "${opensearch_version}" + testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: '2.1' + testImplementation group: 'org.mockito', name: 'mockito-core', version: '3.5.0' + testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '3.5.0' + testImplementation group: 'org.opensearch.client', name: 'opensearch-rest-high-level-client', version: "${opensearch_version}" + testImplementation group: 'org.opensearch.test', name: 'framework', version: "${opensearch_version}" } test { diff --git a/plugin/build.gradle b/plugin/build.gradle index bd38048c01..1208c49b83 100644 --- a/plugin/build.gradle +++ b/plugin/build.gradle @@ -62,10 +62,10 @@ configurations.all { } dependencies { - compile group: 'org.springframework', name: 'spring-beans', version: "${spring_version}" - compile project(":ppl") - compile project(':legacy') - compile project(':opensearch') + api group: 'org.springframework', name: 'spring-beans', version: "${spring_version}" + api project(":ppl") + api project(':legacy') + api project(':opensearch') } diff --git a/ppl/build.gradle b/ppl/build.gradle index 8b96d302d8..7cc3220dab 100644 --- a/ppl/build.gradle +++ b/ppl/build.gradle @@ -23,7 +23,7 @@ */ plugins { - id 'java' + id 'java-library' id "io.freefair.lombok" id 'jacoco' id 'antlr' @@ -44,20 +44,20 @@ configurations { dependencies { antlr "org.antlr:antlr4:4.7.1" - compile "org.antlr:antlr4-runtime:4.7.1" - compile group: 'com.google.guava', name: 'guava', version: '31.0.1-jre' - compile group: 'org.opensearch', name: 'opensearch-x-content', version: "${opensearch_version}" - compile group: 'org.json', name: 'json', version: '20180813' - compile group: 'org.springframework', name: 'spring-context', version: "${spring_version}" - compile group: 'org.springframework', name: 'spring-beans', version: "${spring_version}" - compile group: 'org.apache.logging.log4j', name: 'log4j-core', version:'2.17.1' - compile project(':common') - compile project(':core') - compile project(':protocol') + implementation "org.antlr:antlr4-runtime:4.7.1" + implementation group: 'com.google.guava', name: 'guava', version: '31.0.1-jre' + api group: 'org.opensearch', name: 'opensearch-x-content', version: "${opensearch_version}" + api group: 'org.json', name: 'json', version: '20180813' + implementation group: 'org.springframework', name: 'spring-context', version: "${spring_version}" + implementation group: 'org.springframework', name: 'spring-beans', version: "${spring_version}" + implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version:'2.17.1' + api project(':common') + api project(':core') + api project(':protocol') - testCompile group: 'junit', name: 'junit', version: '4.13.2' - testCompile group: 'org.hamcrest', name: 'hamcrest-library', version: '2.1' - testCompile group: 'org.mockito', name: 'mockito-core', version: '3.3.3' + testImplementation group: 'junit', name: 'junit', version: '4.13.2' + testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: '2.1' + testImplementation group: 'org.mockito', name: 'mockito-core', version: '3.3.3' } diff --git a/protocol/build.gradle b/protocol/build.gradle index bd36f4dc06..260829d7ca 100644 --- a/protocol/build.gradle +++ b/protocol/build.gradle @@ -29,18 +29,18 @@ plugins { } dependencies { - compile group: 'com.google.guava', name: 'guava', version: '31.0.1-jre' - compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: "${jackson_version}" - compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: "${jackson_databind_version}" - compile group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-cbor', version: "${jackson_version}" + implementation group: 'com.google.guava', name: 'guava', version: '31.0.1-jre' + implementation group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: "${jackson_version}" + implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: "${jackson_databind_version}" + implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-cbor', version: "${jackson_version}" implementation 'com.google.code.gson:gson:2.8.9' - compile project(':core') - compile project(':opensearch') + implementation project(':core') + implementation project(':opensearch') testImplementation('org.junit.jupiter:junit-jupiter:5.6.2') - testCompile group: 'org.hamcrest', name: 'hamcrest-library', version: '2.1' - testCompile group: 'org.mockito', name: 'mockito-core', version: '3.3.3' - testCompile group: 'org.mockito', name: 'mockito-junit-jupiter', version: '3.3.3' + testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: '2.1' + testImplementation group: 'org.mockito', name: 'mockito-core', version: '3.3.3' + testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '3.3.3' } test { diff --git a/sql-jdbc/build.gradle b/sql-jdbc/build.gradle index a4324080fd..843651e40c 100644 --- a/sql-jdbc/build.gradle +++ b/sql-jdbc/build.gradle @@ -24,7 +24,7 @@ plugins { group 'org.opensearch.client' // keep version in sync with version in Driver source -version '1.3.0.0' +version '2.0.0.0' boolean snapshot = "true".equals(System.getProperty("build.snapshot", "false")); if (snapshot) { diff --git a/sql/build.gradle b/sql/build.gradle index 8572be7f3f..496b9a7250 100644 --- a/sql/build.gradle +++ b/sql/build.gradle @@ -44,19 +44,19 @@ configurations { dependencies { antlr "org.antlr:antlr4:4.7.1" - compile "org.antlr:antlr4-runtime:4.7.1" + implementation "org.antlr:antlr4-runtime:4.7.1" implementation group: 'com.google.guava', name: 'guava', version: '31.0.1-jre' - compile group: 'org.json', name: 'json', version:'20180813' - compile group: 'org.springframework', name: 'spring-context', version: "${spring_version}" - compile group: 'org.springframework', name: 'spring-beans', version: "${spring_version}" - compile project(':common') - compile project(':core') - compile project(':protocol') + implementation group: 'org.json', name: 'json', version:'20180813' + implementation group: 'org.springframework', name: 'spring-context', version: "${spring_version}" + implementation group: 'org.springframework', name: 'spring-beans', version: "${spring_version}" + implementation project(':common') + implementation project(':core') + api project(':protocol') testImplementation('org.junit.jupiter:junit-jupiter:5.6.2') - testCompile group: 'org.hamcrest', name: 'hamcrest-library', version: '2.1' - testCompile group: 'org.mockito', name: 'mockito-core', version: '3.3.3' - testCompile group: 'org.mockito', name: 'mockito-junit-jupiter', version: '3.3.3' + testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: '2.1' + testImplementation group: 'org.mockito', name: 'mockito-core', version: '3.3.3' + testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '3.3.3' } test {