diff --git a/.ci/init.gradle b/.ci/init.gradle index 36eec780a60..215982b1593 100644 --- a/.ci/init.gradle +++ b/.ci/init.gradle @@ -2,88 +2,88 @@ import com.bettercloud.vault.VaultConfig; import com.bettercloud.vault.Vault; initscript { - repositories { - mavenCentral() - } - dependencies { - classpath 'com.bettercloud:vault-java-driver:4.1.0' - } + repositories { + mavenCentral() + } + dependencies { + classpath 'com.bettercloud:vault-java-driver:4.1.0' + } } -boolean USE_ARTIFACTORY=false +boolean USE_ARTIFACTORY = false if (System.getenv('VAULT_ADDR') == null) { - throw new GradleException("You must set the VAULT_ADDR environment variable to use this init script.") + throw new GradleException("You must set the VAULT_ADDR environment variable to use this init script.") } if (System.getenv('VAULT_ROLE_ID') == null && System.getenv('VAULT_SECRET_ID') == null && System.getenv('VAULT_TOKEN') == null) { - throw new GradleException("You must set either the VAULT_ROLE_ID and VAULT_SECRET_ID environment variables, " + - "or the VAULT_TOKEN environment variable to use this init script.") + throw new GradleException("You must set either the VAULT_ROLE_ID and VAULT_SECRET_ID environment variables, " + + "or the VAULT_TOKEN environment variable to use this init script.") } final String vaultToken = System.getenv('VAULT_TOKEN') ?: new Vault( - new VaultConfig() - .address(System.env.VAULT_ADDR) - .engineVersion(1) - .build() - ) - .withRetries(5, 1000) - .auth() - .loginByAppRole("approle", System.env.VAULT_ROLE_ID, System.env.VAULT_SECRET_ID) - .getAuthClientToken(); + new VaultConfig() + .address(System.env.VAULT_ADDR) + .engineVersion(1) + .build() +) + .withRetries(5, 1000) + .auth() + .loginByAppRole("approle", System.env.VAULT_ROLE_ID, System.env.VAULT_SECRET_ID) + .getAuthClientToken(); final Vault vault = new Vault( - new VaultConfig() - .address(System.env.VAULT_ADDR) - .engineVersion(1) - .token(vaultToken) - .build() + new VaultConfig() + .address(System.env.VAULT_ADDR) + .engineVersion(1) + .token(vaultToken) + .build() ) - .withRetries(5, 1000) + .withRetries(5, 1000) if (USE_ARTIFACTORY) { - final Map artifactoryCredentials = vault.logical() - .read("secret/elasticsearch-ci/artifactory.elstc.co") - .getData(); - logger.info("Using elastic artifactory repos") - Closure configCache = { - return { - name "artifactory-gradle-release" - url "https://artifactory.elstc.co/artifactory/gradle-release" - credentials { - username artifactoryCredentials.get("username") - password artifactoryCredentials.get("token") - } - } + final Map artifactoryCredentials = vault.logical() + .read("secret/elasticsearch-ci/artifactory.elstc.co") + .getData(); + logger.info("Using elastic artifactory repos") + Closure configCache = { + return { + name "artifactory-gradle-release" + url "https://artifactory.elstc.co/artifactory/gradle-release" + credentials { + username artifactoryCredentials.get("username") + password artifactoryCredentials.get("token") + } } - settingsEvaluated { settings -> - settings.pluginManagement { - repositories { - maven configCache() - } - } + } + settingsEvaluated { settings -> + settings.pluginManagement { + repositories { + maven configCache() + } } - projectsLoaded { - allprojects { - buildscript { - repositories { - maven configCache() - } - } - repositories { - maven configCache() - } + } + projectsLoaded { + allprojects { + buildscript { + repositories { + maven configCache() } + } + repositories { + maven configCache() + } } + } } projectsLoaded { - rootProject { - project.pluginManager.withPlugin('com.gradle.build-scan') { - buildScan.server = 'https://gradle-enterprise.elastic.co' - } + rootProject { + project.pluginManager.withPlugin('com.gradle.build-scan') { + buildScan.server = 'https://gradle-enterprise.elastic.co' } + } } @@ -91,24 +91,24 @@ final String buildCacheUrl = System.getProperty('org.elasticsearch.build.cache.u final boolean buildCachePush = Boolean.valueOf(System.getProperty('org.elasticsearch.build.cache.push', 'false')) if (buildCacheUrl) { - final Map buildCacheCredentials = vault.logical() - .read("secret/elasticsearch-ci/gradle-build-cache") - .getData(); - gradle.settingsEvaluated { settings -> - settings.buildCache { - local { - // Disable the local build cache in CI since we use ephemeral workers and it incurs an IO penalty - enabled = false - } - remote(HttpBuildCache) { - url = buildCacheUrl - push = buildCachePush - credentials { - username = buildCacheCredentials.get("username") - password = buildCacheCredentials.get("password") - } - } + final Map buildCacheCredentials = vault.logical() + .read("secret/elasticsearch-ci/gradle-build-cache") + .getData(); + gradle.settingsEvaluated { settings -> + settings.buildCache { + local { + // Disable the local build cache in CI since we use ephemeral workers and it incurs an IO penalty + enabled = false + } + remote(HttpBuildCache) { + url = buildCacheUrl + push = buildCachePush + credentials { + username = buildCacheCredentials.get("username") + password = buildCacheCredentials.get("password") } + } } + } } diff --git a/.editorconfig b/.editorconfig index c3a32bede32..06df99495e0 100644 --- a/.editorconfig +++ b/.editorconfig @@ -2,12 +2,15 @@ root = true -[*.java] +[*] charset = utf-8 -indent_style = space -indent_size = 4 trim_trailing_whitespace = true insert_final_newline = true +indent_style = space +indent_size = 4 [*.bat] indent_size = 2 + +[*.gradle] +indent_size = 2 diff --git a/benchmarks/build.gradle b/benchmarks/build.gradle index 9756481b621..e1563d18dc2 100644 --- a/benchmarks/build.gradle +++ b/benchmarks/build.gradle @@ -29,16 +29,16 @@ archivesBaseName = 'elasticsearch-benchmarks' test.enabled = false dependencies { - compile(project(":server")) { - // JMH ships with the conflicting version 4.6. This prevents us from using jopt-simple in benchmarks (which should be ok) but allows - // us to invoke the JMH uberjar as usual. - exclude group: 'net.sf.jopt-simple', module: 'jopt-simple' - } - compile "org.openjdk.jmh:jmh-core:$versions.jmh" - annotationProcessor "org.openjdk.jmh:jmh-generator-annprocess:$versions.jmh" - // Dependencies of JMH - runtime 'net.sf.jopt-simple:jopt-simple:4.6' - runtime 'org.apache.commons:commons-math3:3.2' + compile(project(":server")) { + // JMH ships with the conflicting version 4.6. This prevents us from using jopt-simple in benchmarks (which should be ok) but allows + // us to invoke the JMH uberjar as usual. + exclude group: 'net.sf.jopt-simple', module: 'jopt-simple' + } + compile "org.openjdk.jmh:jmh-core:$versions.jmh" + annotationProcessor "org.openjdk.jmh:jmh-generator-annprocess:$versions.jmh" + // Dependencies of JMH + runtime 'net.sf.jopt-simple:jopt-simple:4.6' + runtime 'org.apache.commons:commons-math3:3.2' } compileJava.options.compilerArgs << "-Xlint:-cast,-rawtypes,-unchecked,-processing" @@ -55,13 +55,13 @@ forbiddenApisMain.enabled = false dependencyLicenses.enabled = false dependenciesInfo.enabled = false -thirdPartyAudit.ignoreViolations ( - // these classes intentionally use JDK internal API (and this is ok since the project is maintained by Oracle employees) - 'org.openjdk.jmh.profile.AbstractHotspotProfiler', - 'org.openjdk.jmh.profile.HotspotThreadProfiler', - 'org.openjdk.jmh.profile.HotspotClassloadingProfiler', - 'org.openjdk.jmh.profile.HotspotCompilationProfiler', - 'org.openjdk.jmh.profile.HotspotMemoryProfiler', - 'org.openjdk.jmh.profile.HotspotRuntimeProfiler', - 'org.openjdk.jmh.util.Utils' +thirdPartyAudit.ignoreViolations( + // these classes intentionally use JDK internal API (and this is ok since the project is maintained by Oracle employees) + 'org.openjdk.jmh.profile.AbstractHotspotProfiler', + 'org.openjdk.jmh.profile.HotspotThreadProfiler', + 'org.openjdk.jmh.profile.HotspotClassloadingProfiler', + 'org.openjdk.jmh.profile.HotspotCompilationProfiler', + 'org.openjdk.jmh.profile.HotspotMemoryProfiler', + 'org.openjdk.jmh.profile.HotspotRuntimeProfiler', + 'org.openjdk.jmh.util.Utils' ) diff --git a/build.gradle b/build.gradle index 26888d51e10..271e54a566a 100644 --- a/build.gradle +++ b/build.gradle @@ -32,10 +32,10 @@ import org.gradle.util.GradleVersion import static org.elasticsearch.gradle.tool.Boilerplate.maybeConfigure plugins { - id 'com.gradle.build-scan' version '2.4.2' - id 'lifecycle-base' - id 'elasticsearch.global-build-info' - id "com.diffplug.gradle.spotless" version "3.24.2" apply false + id 'com.gradle.build-scan' version '2.4.2' + id 'lifecycle-base' + id 'elasticsearch.global-build-info' + id "com.diffplug.gradle.spotless" version "3.24.2" apply false } apply plugin: 'nebula.info-scm' @@ -139,14 +139,14 @@ subprojects { BwcVersions versions = new BwcVersions(file('server/src/main/java/org/elasticsearch/Version.java').readLines('UTF-8')) task updateCIBwcVersions() { - doLast { - File yml = file(".ci/bwcVersions") - yml.text = "" - yml << "BWC_VERSION:\n" - versions.indexCompatible.each { - yml << " - \"$it\"\n" - } + doLast { + File yml = file(".ci/bwcVersions") + yml.text = "" + yml << "BWC_VERSION:\n" + versions.indexCompatible.each { + yml << " - \"$it\"\n" } + } } // build metadata from previous build, contains eg hashes for bwc builds @@ -164,9 +164,9 @@ allprojects { project.ext { // for ide hacks... isEclipse = System.getProperty("eclipse.launcher") != null || // Detects gradle launched from Eclipse's IDE - System.getProperty("eclipse.application") != null || // Detects gradle launched from the Eclipse compiler server - gradle.startParameter.taskNames.contains('eclipse') || // Detects gradle launched from the command line to do eclipse stuff - gradle.startParameter.taskNames.contains('cleanEclipse') + System.getProperty("eclipse.application") != null || // Detects gradle launched from the Eclipse compiler server + gradle.startParameter.taskNames.contains('eclipse') || // Detects gradle launched from the command line to do eclipse stuff + gradle.startParameter.taskNames.contains('cleanEclipse') isIdea = System.getProperty("idea.active") != null || gradle.startParameter.taskNames.contains('idea') || gradle.startParameter.taskNames.contains('cleanIdea') // for BWC testing @@ -181,22 +181,22 @@ task verifyVersions { if (gradle.startParameter.isOffline()) { throw new GradleException("Must run in online mode to verify versions") } - // Read the list from maven central. - // Fetch the metadata an parse the xml into Version instances because it's more straight forward here + // Read the list from maven central. + // Fetch the metadata an parse the xml into Version instances because it's more straight forward here // rather than bwcVersion ( VersionCollection ). new URL('https://repo1.maven.org/maven2/org/elasticsearch/elasticsearch/maven-metadata.xml').openStream().withStream { s -> bwcVersions.compareToAuthoritative( - new XmlParser().parse(s) - .versioning.versions.version - .collect { it.text() }.findAll { it ==~ /\d+\.\d+\.\d+/ } - .collect { Version.fromString(it) } + new XmlParser().parse(s) + .versioning.versions.version + .collect { it.text() }.findAll { it ==~ /\d+\.\d+\.\d+/ } + .collect { Version.fromString(it) } ) } String ciYml = file(".ci/bwcVersions").text bwcVersions.indexCompatible.each { - if (ciYml.contains("\"$it\"\n") == false) { - throw new Exception(".ci/bwcVersions is outdated, run `./gradlew updateCIBwcVersions` and check in the results"); - } + if (ciYml.contains("\"$it\"\n") == false) { + throw new Exception(".ci/bwcVersions is outdated, run `./gradlew updateCIBwcVersions` and check in the results"); + } } } } @@ -250,7 +250,7 @@ allprojects { // the "value" -quiet is added, separated by a space. This is ok since the javadoc // command already adds -quiet, so we are just duplicating it // see https://discuss.gradle.org/t/add-custom-javadoc-option-that-does-not-take-an-argument/5959 - javadoc.options.encoding='UTF8' + javadoc.options.encoding = 'UTF8' javadoc.options.addStringOption('Xdoclint:all,-missing', '-quiet') } @@ -291,19 +291,19 @@ allprojects { } boolean hasShadow = project.plugins.hasPlugin(ShadowPlugin) project.configurations.compile.dependencies - .findAll() - .toSorted(sortClosure) - .each({ c -> depJavadocClosure(hasShadow, c) }) + .findAll() + .toSorted(sortClosure) + .each({ c -> depJavadocClosure(hasShadow, c) }) project.configurations.compileOnly.dependencies - .findAll() - .toSorted(sortClosure) - .each({ c -> depJavadocClosure(false, c) }) + .findAll() + .toSorted(sortClosure) + .each({ c -> depJavadocClosure(false, c) }) if (hasShadow) { // include any dependencies for shadow JAR projects that are *not* bundled in the shadow JAR project.configurations.shadow.dependencies - .findAll() - .toSorted(sortClosure) - .each({ c -> depJavadocClosure(false, c) }) + .findAll() + .toSorted(sortClosure) + .each({ c -> depJavadocClosure(false, c) }) } } } @@ -363,7 +363,7 @@ allprojects { } tasks.named('cleanIdea') { - delete 'build-idea' + delete 'build-idea' } } @@ -402,9 +402,9 @@ allprojects { prefix = prefix.replace(':', '_') } if (eclipse.project.name.startsWith(prefix)) { - licenseHeaderFile = new File(project.rootDir, 'buildSrc/src/main/resources/license-headers/elastic-license-header.txt') + licenseHeaderFile = new File(project.rootDir, 'buildSrc/src/main/resources/license-headers/elastic-license-header.txt') } else { - licenseHeaderFile = new File(project.rootDir, 'buildSrc/src/main/resources/license-headers/oss-license-header.txt') + licenseHeaderFile = new File(project.rootDir, 'buildSrc/src/main/resources/license-headers/oss-license-header.txt') } String lineSeparator = Os.isFamily(Os.FAMILY_WINDOWS) ? '\\\\r\\\\n' : '\\\\n' @@ -414,7 +414,7 @@ allprojects { // TODO: "package this up" for external builds from new File(project.rootDir, 'buildSrc/src/main/resources/eclipse.settings') into '.settings' - filter{ it.replaceAll('@@LICENSE_HEADER_TEXT@@', licenseHeader)} + filter { it.replaceAll('@@LICENSE_HEADER_TEXT@@', licenseHeader) } } // otherwise .settings is not nuked entirely tasks.register('wipeEclipseSettings', Delete) { @@ -431,13 +431,14 @@ class Run extends DefaultTask { boolean debug = false @Option( - option = "debug-jvm", - description = "Enable debugging configuration, to allow attaching a debugger to elasticsearch." + option = "debug-jvm", + description = "Enable debugging configuration, to allow attaching a debugger to elasticsearch." ) public void setDebug(boolean enabled) { project.project(':distribution').run.debug = enabled } } + task run(type: Run) { dependsOn ':distribution:run' description = 'Runs elasticsearch in the foreground' @@ -446,20 +447,20 @@ task run(type: Run) { } wrapper { - distributionType = 'ALL' - doLast { - final DistributionLocator locator = new DistributionLocator() - final GradleVersion version = GradleVersion.version(wrapper.gradleVersion) - final URI distributionUri = locator.getDistributionFor(version, wrapper.distributionType.name().toLowerCase(Locale.ENGLISH)) - final URI sha256Uri = new URI(distributionUri.toString() + ".sha256") - final String sha256Sum = new String(sha256Uri.toURL().bytes) - wrapper.getPropertiesFile() << "distributionSha256Sum=${sha256Sum}\n" - println "Added checksum to wrapper properties" - // Update build-tools to reflect the Gradle upgrade - // TODO: we can remove this once we have tests to make sure older versions work. - project(':build-tools').file('src/main/resources/minimumGradleVersion').text = gradleVersion - println "Updated minimum Gradle Version" - } + distributionType = 'ALL' + doLast { + final DistributionLocator locator = new DistributionLocator() + final GradleVersion version = GradleVersion.version(wrapper.gradleVersion) + final URI distributionUri = locator.getDistributionFor(version, wrapper.distributionType.name().toLowerCase(Locale.ENGLISH)) + final URI sha256Uri = new URI(distributionUri.toString() + ".sha256") + final String sha256Sum = new String(sha256Uri.toURL().bytes) + wrapper.getPropertiesFile() << "distributionSha256Sum=${sha256Sum}\n" + println "Added checksum to wrapper properties" + // Update build-tools to reflect the Gradle upgrade + // TODO: we can remove this once we have tests to make sure older versions work. + project(':build-tools').file('src/main/resources/minimumGradleVersion').text = gradleVersion + println "Updated minimum Gradle Version" + } } gradle.projectsEvaluated { @@ -485,10 +486,10 @@ gradle.projectsEvaluated { String coords = "${p.group}:${p.name}" if (false == coordsToProject.putIfAbsent(coords, p)) { throw new GradleException( - "Detected that two projects: ${p.path} and ${coordsToProject[coords].path} " + - "have the same name and group: ${coords}. " + - "This doesn't currently work correctly in Gradle, see: " + - "https://github.com/gradle/gradle/issues/847" + "Detected that two projects: ${p.path} and ${coordsToProject[coords].path} " + + "have the same name and group: ${coords}. " + + "This doesn't currently work correctly in Gradle, see: " + + "https://github.com/gradle/gradle/issues/847" ) } } @@ -496,10 +497,10 @@ gradle.projectsEvaluated { allprojects { tasks.register('resolveAllDependencies') { - dependsOn tasks.matching { it.name == "pullFixture"} - doLast { - configurations.findAll { it.isCanBeResolved() }.each { it.resolve() } - } + dependsOn tasks.matching { it.name == "pullFixture" } + doLast { + configurations.findAll { it.isCanBeResolved() }.each { it.resolve() } + } } // helper task to print direct dependencies of a single task @@ -528,10 +529,10 @@ allprojects { def checkPart1 = tasks.register('checkPart1') def checkPart2 = tasks.register('checkPart2') plugins.withId('lifecycle-base') { - if (project.path.startsWith(":x-pack:")) { - checkPart2.configure { dependsOn 'check' } - } else { - checkPart1.configure { dependsOn 'check' } - } + if (project.path.startsWith(":x-pack:")) { + checkPart2.configure { dependsOn 'check' } + } else { + checkPart1.configure { dependsOn 'check' } + } } } diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index eb72a1bd230..f143f19412c 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -28,7 +28,7 @@ group = 'org.elasticsearch.gradle' String minimumGradleVersion = file('src/main/resources/minimumGradleVersion').text.trim() if (GradleVersion.current() < GradleVersion.version(minimumGradleVersion)) { - throw new GradleException("Gradle ${minimumGradleVersion}+ is required to build elasticsearch") + throw new GradleException("Gradle ${minimumGradleVersion}+ is required to build elasticsearch") } if (project == rootProject) { @@ -66,8 +66,8 @@ if (JavaVersion.current() < JavaVersion.VERSION_11) { } sourceSets { - // We have a few classes that need to be compiled for older java versions - minimumRuntime { } + // We have a few classes that need to be compiled for older java versions + minimumRuntime {} } configurations { @@ -75,16 +75,16 @@ configurations { } compileMinimumRuntimeJava { - targetCompatibility = 8 - sourceCompatibility = 8 + targetCompatibility = 8 + sourceCompatibility = 8 } jar { - from sourceSets.minimumRuntime.output + from sourceSets.minimumRuntime.output } javadoc { - source sourceSets.minimumRuntime.allSource + source sourceSets.minimumRuntime.allSource } /***************************************************************************** @@ -102,7 +102,7 @@ dependencies { } compile localGroovy() - + compile 'commons-codec:commons-codec:1.12' compile 'org.apache.commons:commons-compress:1.19' @@ -186,13 +186,13 @@ if (project != rootProject) { distribution project(':distribution:archives:linux-tar') distribution project(':distribution:archives:oss-linux-tar') } - + // for external projects we want to remove the marker file indicating we are running the Elasticsearch project processResources { - exclude 'buildSrc.marker' - into('META-INF') { - from configurations.reaper - } + exclude 'buildSrc.marker' + into('META-INF') { + from configurations.reaper + } } // TODO: re-enable once randomizedtesting gradle code is published and removed from here @@ -255,8 +255,8 @@ class VersionPropertiesLoader { } if (elasticsearch.matches("[0-9]+\\.[0-9]+\\.[0-9]+") == false) { throw new IllegalStateException( - "Expected elasticsearch version to be numbers only of the form X.Y.Z but it was: " + - elasticsearch + "Expected elasticsearch version to be numbers only of the form X.Y.Z but it was: " + + elasticsearch ) } String qualifier = systemProperties.getProperty("build.version_qualifier", ""); diff --git a/buildSrc/reaper/build.gradle b/buildSrc/reaper/build.gradle index 81b6fd9ab6d..b816aaa4f58 100644 --- a/buildSrc/reaper/build.gradle +++ b/buildSrc/reaper/build.gradle @@ -1,8 +1,8 @@ apply plugin: 'java' jar { - archiveName = "${project.name}.jar" - manifest { - attributes 'Main-Class': 'org.elasticsearch.gradle.reaper.Reaper' - } + archiveName = "${project.name}.jar" + manifest { + attributes 'Main-Class': 'org.elasticsearch.gradle.reaper.Reaper' + } } diff --git a/buildSrc/src/testKit/distribution-download/build.gradle b/buildSrc/src/testKit/distribution-download/build.gradle index fbdddd3f4f3..ba6d06e9b70 100644 --- a/buildSrc/src/testKit/distribution-download/build.gradle +++ b/buildSrc/src/testKit/distribution-download/build.gradle @@ -22,34 +22,34 @@ import org.elasticsearch.gradle.info.BuildParams */ plugins { - id 'elasticsearch.global-build-info' + id 'elasticsearch.global-build-info' } boolean internal = Boolean.parseBoolean(System.getProperty("tests.internal", "true")) BuildParams.init { it.setIsInternal(internal) } project.gradle.projectsEvaluated { - // wire the download service url to wiremock - String fakeDownloadService = System.getProperty('tests.download_service') - if (fakeDownloadService != null) { - IvyArtifactRepository repository = (IvyArtifactRepository) rootProject.repositories.getByName("elasticsearch-downloads") - repository.setUrl(fakeDownloadService) - repository = (IvyArtifactRepository) project('subproj').repositories.getByName("elasticsearch-downloads") - repository.setUrl(fakeDownloadService) - if (internal == false) { - repository = (IvyArtifactRepository) rootProject.repositories.getByName("elasticsearch-snapshots") - repository.setUrl(fakeDownloadService) - repository = (IvyArtifactRepository) project('subproj').repositories.getByName("elasticsearch-snapshots") - repository.setUrl(fakeDownloadService) - } + // wire the download service url to wiremock + String fakeDownloadService = System.getProperty('tests.download_service') + if (fakeDownloadService != null) { + IvyArtifactRepository repository = (IvyArtifactRepository) rootProject.repositories.getByName("elasticsearch-downloads") + repository.setUrl(fakeDownloadService) + repository = (IvyArtifactRepository) project('subproj').repositories.getByName("elasticsearch-downloads") + repository.setUrl(fakeDownloadService) + if (internal == false) { + repository = (IvyArtifactRepository) rootProject.repositories.getByName("elasticsearch-snapshots") + repository.setUrl(fakeDownloadService) + repository = (IvyArtifactRepository) project('subproj').repositories.getByName("elasticsearch-snapshots") + repository.setUrl(fakeDownloadService) } + } } if (internal) { - Version currentVersion = Version.fromString("9.0.0") - BwcVersions versions = new BwcVersions(new TreeSet<>( - Arrays.asList(Version.fromString("8.0.0"), Version.fromString("8.0.1"), Version.fromString("8.1.0"), currentVersion)), - currentVersion) - allprojects { - ext.bwcVersions = versions - } + Version currentVersion = Version.fromString("9.0.0") + BwcVersions versions = new BwcVersions(new TreeSet<>( + Arrays.asList(Version.fromString("8.0.0"), Version.fromString("8.0.1"), Version.fromString("8.1.0"), currentVersion)), + currentVersion) + allprojects { + ext.bwcVersions = versions + } } diff --git a/buildSrc/src/testKit/distribution-download/distribution/build.gradle b/buildSrc/src/testKit/distribution-download/distribution/build.gradle index d0fdf038a60..f375eb3141b 100644 --- a/buildSrc/src/testKit/distribution-download/distribution/build.gradle +++ b/buildSrc/src/testKit/distribution-download/distribution/build.gradle @@ -1,4 +1,3 @@ - String distroConfig = System.getProperty('tests.local_distro.config') if (distroConfig != null) { // setup the test distribution as an artifact of this project diff --git a/buildSrc/src/testKit/distribution-download/subproj/build.gradle b/buildSrc/src/testKit/distribution-download/subproj/build.gradle index bc7b631d5eb..3be075d20cc 100644 --- a/buildSrc/src/testKit/distribution-download/subproj/build.gradle +++ b/buildSrc/src/testKit/distribution-download/subproj/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'elasticsearch.distribution-download' + id 'elasticsearch.distribution-download' } String distroVersion = System.getProperty('tests.distro.version') diff --git a/buildSrc/src/testKit/elasticsearch-build-resources/build.gradle b/buildSrc/src/testKit/elasticsearch-build-resources/build.gradle index c87c097e6be..741729df6f0 100644 --- a/buildSrc/src/testKit/elasticsearch-build-resources/build.gradle +++ b/buildSrc/src/testKit/elasticsearch-build-resources/build.gradle @@ -1,38 +1,38 @@ plugins { - id 'elasticsearch.build' + id 'elasticsearch.build' } ext.licenseFile = file("$buildDir/dummy/license") ext.noticeFile = file("$buildDir/dummy/notice") buildResources { - copy 'checkstyle.xml' + copy 'checkstyle.xml' } task sampleCopyAll(type: Sync) { - /** Note: no explicit dependency. This works with tasks that use the Provider API a.k.a "Lazy Configuration" **/ - from buildResources - into "$buildDir/sampleCopyAll" + /** Note: no explicit dependency. This works with tasks that use the Provider API a.k.a "Lazy Configuration" **/ + from buildResources + into "$buildDir/sampleCopyAll" } task sample { - // This does not work, task dependencies can't be providers - // dependsOn buildResources.resource('minimumRuntimeVersion') - // Nor does this, despite https://github.com/gradle/gradle/issues/3811 - // dependsOn buildResources.outputDir - // for now it's just - dependsOn buildResources - // we have to reference it at configuration time in order to be picked up - ext.checkstyle_suppressions = buildResources.copy('checkstyle_suppressions.xml') - doLast { - println "This task is using ${file(checkstyle_suppressions)}" - } + // This does not work, task dependencies can't be providers + // dependsOn buildResources.resource('minimumRuntimeVersion') + // Nor does this, despite https://github.com/gradle/gradle/issues/3811 + // dependsOn buildResources.outputDir + // for now it's just + dependsOn buildResources + // we have to reference it at configuration time in order to be picked up + ext.checkstyle_suppressions = buildResources.copy('checkstyle_suppressions.xml') + doLast { + println "This task is using ${file(checkstyle_suppressions)}" + } } task noConfigAfterExecution { - dependsOn buildResources - doLast { - println "This should cause an error because we are refferencing " + - "${buildResources.copy('checkstyle_suppressions.xml')} after the `buildResources` task has ran." - } + dependsOn buildResources + doLast { + println "This should cause an error because we are refferencing " + + "${buildResources.copy('checkstyle_suppressions.xml')} after the `buildResources` task has ran." + } } diff --git a/buildSrc/src/testKit/elasticsearch.build/build.gradle b/buildSrc/src/testKit/elasticsearch.build/build.gradle index 03ff3f90275..1f3e00efa3b 100644 --- a/buildSrc/src/testKit/elasticsearch.build/build.gradle +++ b/buildSrc/src/testKit/elasticsearch.build/build.gradle @@ -1,19 +1,19 @@ plugins { - id 'java' - id 'elasticsearch.build' + id 'java' + id 'elasticsearch.build' } ext.licenseFile = file("LICENSE") ext.noticeFile = file("NOTICE") dependencies { - compile "junit:junit:${versions.junit}" - // missing classes in thirdparty audit - compile 'org.hamcrest:hamcrest-core:1.3' + compile "junit:junit:${versions.junit}" + // missing classes in thirdparty audit + compile 'org.hamcrest:hamcrest-core:1.3' } repositories { - jcenter() + jcenter() } // todo remove offending rules @@ -28,7 +28,7 @@ thirdPartyAudit.enabled = false loggerUsageCheck.enabled = false task hello { - doFirst { - println "build plugin can be applied" - } + doFirst { + println "build plugin can be applied" + } } diff --git a/buildSrc/src/testKit/jdk-download/build.gradle b/buildSrc/src/testKit/jdk-download/build.gradle index 0bf28ec4c85..ff653354d9e 100644 --- a/buildSrc/src/testKit/jdk-download/build.gradle +++ b/buildSrc/src/testKit/jdk-download/build.gradle @@ -1,17 +1,16 @@ - project.gradle.projectsEvaluated { - // wire the jdk repo to wiremock - String fakeJdkRepo = Objects.requireNonNull(System.getProperty('tests.jdk_repo')) - String fakeJdkVendor = Objects.requireNonNull(System.getProperty('tests.jdk_vendor')) - String fakeJdkVersion = Objects.requireNonNull(System.getProperty('tests.jdk_version')) - println rootProject.repositories.asMap.keySet() - IvyArtifactRepository repository = - (IvyArtifactRepository) rootProject.repositories.getByName("jdk_repo_${fakeJdkVendor}_${fakeJdkVersion}") - repository.setUrl(fakeJdkRepo) + // wire the jdk repo to wiremock + String fakeJdkRepo = Objects.requireNonNull(System.getProperty('tests.jdk_repo')) + String fakeJdkVendor = Objects.requireNonNull(System.getProperty('tests.jdk_vendor')) + String fakeJdkVersion = Objects.requireNonNull(System.getProperty('tests.jdk_version')) + println rootProject.repositories.asMap.keySet() + IvyArtifactRepository repository = + (IvyArtifactRepository) rootProject.repositories.getByName("jdk_repo_${fakeJdkVendor}_${fakeJdkVersion}") + repository.setUrl(fakeJdkRepo) } task numConfigurations { - doLast { - println "NUM CONFIGS: ${project.configurations.size()}" - } -} \ No newline at end of file + doLast { + println "NUM CONFIGS: ${project.configurations.size()}" + } +} diff --git a/buildSrc/src/testKit/jdk-download/reuse/build.gradle b/buildSrc/src/testKit/jdk-download/reuse/build.gradle index b04ad78db81..795098c4b52 100644 --- a/buildSrc/src/testKit/jdk-download/reuse/build.gradle +++ b/buildSrc/src/testKit/jdk-download/reuse/build.gradle @@ -3,9 +3,9 @@ evaluationDependsOn ':subproj' String fakeJdkVendor = Objects.requireNonNull(System.getProperty('tests.jdk_vendor')) String fakeJdkVersion = Objects.requireNonNull(System.getProperty('tests.jdk_version')) jdks { - linux_jdk { - vendor = fakeJdkVendor - version = fakeJdkVersion - platform = "linux" - } -} \ No newline at end of file + linux_jdk { + vendor = fakeJdkVendor + version = fakeJdkVersion + platform = "linux" + } +} diff --git a/buildSrc/src/testKit/jdk-download/subproj/build.gradle b/buildSrc/src/testKit/jdk-download/subproj/build.gradle index 399f8d587ed..a0713bef204 100644 --- a/buildSrc/src/testKit/jdk-download/subproj/build.gradle +++ b/buildSrc/src/testKit/jdk-download/subproj/build.gradle @@ -1,45 +1,45 @@ plugins { - id 'elasticsearch.jdk-download' + id 'elasticsearch.jdk-download' } String fakeJdkVendor = Objects.requireNonNull(System.getProperty('tests.jdk_vendor')) String fakeJdkVersion = Objects.requireNonNull(System.getProperty('tests.jdk_version')) jdks { - linux { - vendor = fakeJdkVendor - version = fakeJdkVersion - platform = "linux" - } - darwin { - vendor = fakeJdkVendor - version = fakeJdkVersion - platform = "darwin" - } - windows { - vendor = fakeJdkVendor - version = fakeJdkVersion - platform = "windows" - } + linux { + vendor = fakeJdkVendor + version = fakeJdkVersion + platform = "linux" + } + darwin { + vendor = fakeJdkVendor + version = fakeJdkVersion + platform = "darwin" + } + windows { + vendor = fakeJdkVendor + version = fakeJdkVersion + platform = "windows" + } } task getLinuxJdk { - dependsOn jdks.linux - doLast { - println "JDK HOME: " + jdks.linux - } + dependsOn jdks.linux + doLast { + println "JDK HOME: " + jdks.linux + } } task getDarwinJdk { - dependsOn jdks.darwin - doLast { - println "JDK HOME: " + jdks.darwin - } + dependsOn jdks.darwin + doLast { + println "JDK HOME: " + jdks.darwin + } } task getWindowsJdk { - dependsOn jdks.windows - doLast { - println "JDK HOME: " + jdks.windows - } -} \ No newline at end of file + dependsOn jdks.windows + doLast { + println "JDK HOME: " + jdks.windows + } +} diff --git a/buildSrc/src/testKit/reaper/build.gradle b/buildSrc/src/testKit/reaper/build.gradle index 64e9f48545c..2ee2cb6a38b 100644 --- a/buildSrc/src/testKit/reaper/build.gradle +++ b/buildSrc/src/testKit/reaper/build.gradle @@ -1,11 +1,11 @@ plugins { - id 'elasticsearch.reaper' + id 'elasticsearch.reaper' } task launchReaper { - doLast { - def reaper = project.extensions.getByName('reaper') - reaper.registerCommand('test', 'true') - reaper.unregister('test') - } -} \ No newline at end of file + doLast { + def reaper = project.extensions.getByName('reaper') + reaper.registerCommand('test', 'true') + reaper.unregister('test') + } +} diff --git a/buildSrc/src/testKit/symbolic-link-preserving-tar/build.gradle b/buildSrc/src/testKit/symbolic-link-preserving-tar/build.gradle index 5496f22478d..0075dad46ff 100644 --- a/buildSrc/src/testKit/symbolic-link-preserving-tar/build.gradle +++ b/buildSrc/src/testKit/symbolic-link-preserving-tar/build.gradle @@ -1,53 +1,53 @@ import org.elasticsearch.gradle.tar.SymbolicLinkPreservingTar plugins { - id 'base' - id 'distribution' - id 'elasticsearch.symbolic-link-preserving-tar' + id 'base' + id 'distribution' + id 'elasticsearch.symbolic-link-preserving-tar' } final String source = Objects.requireNonNull(System.getProperty('tests.symbolic_link_preserving_tar_source')) boolean preserveFileTimestamps; -final String testPreserveFileTimestamps = - Objects.requireNonNull(System.getProperty('tests.symbolic_link_preserving_tar_preserve_file_timestamps')) +final String testPreserveFileTimestamps = + Objects.requireNonNull(System.getProperty('tests.symbolic_link_preserving_tar_preserve_file_timestamps')) switch (testPreserveFileTimestamps) { - case "true": - preserveFileTimestamps = true - break - case "false": - preserveFileTimestamps = false - break - default: - throw new IllegalArgumentException( - "tests.symbolic_link_preserving_tar_preserve_file_timestamps must be [true] or [false] but was [" - + testPreserveFileTimestamps + "]") + case "true": + preserveFileTimestamps = true + break + case "false": + preserveFileTimestamps = false + break + default: + throw new IllegalArgumentException( + "tests.symbolic_link_preserving_tar_preserve_file_timestamps must be [true] or [false] but was [" + + testPreserveFileTimestamps + "]") } task buildBZip2Tar(type: SymbolicLinkPreservingTar) { SymbolicLinkPreservingTar tar -> - tar.archiveExtension = 'tar.bz2' - tar.compression = Compression.BZIP2 - tar.preserveFileTimestamps = preserveFileTimestamps - from fileTree(source) - doLast { - println archiveFile.get().asFile.path - } + tar.archiveExtension = 'tar.bz2' + tar.compression = Compression.BZIP2 + tar.preserveFileTimestamps = preserveFileTimestamps + from fileTree(source) + doLast { + println archiveFile.get().asFile.path + } } task buildGZipTar(type: SymbolicLinkPreservingTar) { SymbolicLinkPreservingTar tar -> - tar.archiveExtension = 'tar.gz' - tar.compression = Compression.GZIP - tar.preserveFileTimestamps = preserveFileTimestamps - from fileTree(source) - doLast{ - println archiveFile.get().asFile.path - } + tar.archiveExtension = 'tar.gz' + tar.compression = Compression.GZIP + tar.preserveFileTimestamps = preserveFileTimestamps + from fileTree(source) + doLast { + println archiveFile.get().asFile.path + } } task buildTar(type: SymbolicLinkPreservingTar) { SymbolicLinkPreservingTar tar -> - tar.archiveExtension = 'tar' - tar.preserveFileTimestamps = preserveFileTimestamps - from fileTree(source) - doLast{ - println archiveFile.get().asFile.path - } + tar.archiveExtension = 'tar' + tar.preserveFileTimestamps = preserveFileTimestamps + from fileTree(source) + doLast { + println archiveFile.get().asFile.path + } } diff --git a/buildSrc/src/testKit/testingConventions/build.gradle b/buildSrc/src/testKit/testingConventions/build.gradle index dd82a18085f..fa677142e9a 100644 --- a/buildSrc/src/testKit/testingConventions/build.gradle +++ b/buildSrc/src/testKit/testingConventions/build.gradle @@ -1,83 +1,83 @@ plugins { - id 'elasticsearch.build' apply false + id 'elasticsearch.build' apply false } allprojects { - apply plugin: 'java' - apply plugin: 'elasticsearch.build' + apply plugin: 'java' + apply plugin: 'elasticsearch.build' - repositories { - jcenter() - } - dependencies { - testCompile "junit:junit:4.12" - } + repositories { + jcenter() + } + dependencies { + testCompile "junit:junit:4.12" + } - ext.licenseFile = file("$buildDir/dummy/license") - ext.noticeFile = file("$buildDir/dummy/notice") + ext.licenseFile = file("$buildDir/dummy/license") + ext.noticeFile = file("$buildDir/dummy/notice") - testingConventions.naming { - // Reset default to no baseClass checks - Tests { - baseClasses = [] - } - IT { - baseClasses = [] - } + testingConventions.naming { + // Reset default to no baseClass checks + Tests { + baseClasses = [] } + IT { + baseClasses = [] + } + } } project(':empty_test_task') { - task emptyTest(type: Test) { + task emptyTest(type: Test) { - } + } } project(':all_classes_in_tasks') { - test { - include "**/Convention*" - } + test { + include "**/Convention*" + } } project(':not_implementing_base') { - testingConventions.naming { - Tests { - baseClass 'org.elasticsearch.gradle.testkit.Unit' - } - IT { - baseClass 'org.elasticsearch.gradle.testkit.Integration' - } + testingConventions.naming { + Tests { + baseClass 'org.elasticsearch.gradle.testkit.Unit' } - test { - include "**/*IT.class" - include "**/*Tests.class" + IT { + baseClass 'org.elasticsearch.gradle.testkit.Integration' } + } + test { + include "**/*IT.class" + include "**/*Tests.class" + } } project(':valid_setup_no_base') { - test { - include "**/*IT.class" - include "**/*Tests.class" - } + test { + include "**/*IT.class" + include "**/*Tests.class" + } } project(':tests_in_main') { } -project (':valid_setup_with_base') { - test { - include "**/*IT.class" - include "**/*Tests.class" +project(':valid_setup_with_base') { + test { + include "**/*IT.class" + include "**/*Tests.class" + } + testingConventions.naming { + Tests { + baseClass 'org.elasticsearch.gradle.testkit.Unit' } - testingConventions.naming { - Tests { - baseClass 'org.elasticsearch.gradle.testkit.Unit' - } - IT { - baseClass 'org.elasticsearch.gradle.testkit.Integration' - } + IT { + baseClass 'org.elasticsearch.gradle.testkit.Integration' } + } } diff --git a/buildSrc/src/testKit/thirdPartyAudit/build.gradle b/buildSrc/src/testKit/thirdPartyAudit/build.gradle index bc791808513..253d3f0acc1 100644 --- a/buildSrc/src/testKit/thirdPartyAudit/build.gradle +++ b/buildSrc/src/testKit/thirdPartyAudit/build.gradle @@ -1,39 +1,39 @@ import org.elasticsearch.gradle.precommit.ThirdPartyAuditTask plugins { - id 'java' - // bring in build-tools onto the classpath - id 'elasticsearch.global-build-info' apply false + id 'java' + // bring in build-tools onto the classpath + id 'elasticsearch.global-build-info' apply false } repositories { - /** - * Local test repo contains dummy jars with different group names and versions. - * - broken-log4j creates a log4j logger but has no pom, so the class will be missing - * - dummy-io has a class that creates a new java.io.File ( something which third-party-audit-absurd.txt forbids ) - * - version 0.0.2 has the same class and one extra file just to make the jar different - */ - maven { - name = "local-test" - url = file("sample_jars/build/testrepo") - } - jcenter() + /** + * Local test repo contains dummy jars with different group names and versions. + * - broken-log4j creates a log4j logger but has no pom, so the class will be missing + * - dummy-io has a class that creates a new java.io.File ( something which third-party-audit-absurd.txt forbids ) + * - version 0.0.2 has the same class and one extra file just to make the jar different + */ + maven { + name = "local-test" + url = file("sample_jars/build/testrepo") + } + jcenter() } configurations.create("forbiddenApisCliJar") dependencies { - forbiddenApisCliJar 'de.thetaphi:forbiddenapis:2.7' - compileOnly "org.${project.properties.compileOnlyGroup}:${project.properties.compileOnlyVersion}" - compile "org.${project.properties.compileGroup}:${project.properties.compileVersion}" + forbiddenApisCliJar 'de.thetaphi:forbiddenapis:2.7' + compileOnly "org.${project.properties.compileOnlyGroup}:${project.properties.compileOnlyVersion}" + compile "org.${project.properties.compileGroup}:${project.properties.compileVersion}" } task empty(type: ThirdPartyAuditTask) { - targetCompatibility = JavaVersion.VERSION_11 - signatureFile = file('third-party-audit-empty.txt') + targetCompatibility = JavaVersion.VERSION_11 + signatureFile = file('third-party-audit-empty.txt') } task absurd(type: ThirdPartyAuditTask) { - targetCompatibility = JavaVersion.VERSION_11 - signatureFile = file('third-party-audit-absurd.txt') -} \ No newline at end of file + targetCompatibility = JavaVersion.VERSION_11 + signatureFile = file('third-party-audit-absurd.txt') +} diff --git a/buildSrc/src/testKit/thirdPartyAudit/sample_jars/build.gradle b/buildSrc/src/testKit/thirdPartyAudit/sample_jars/build.gradle index 82cda75ff77..23f08e6b4e9 100644 --- a/buildSrc/src/testKit/thirdPartyAudit/sample_jars/build.gradle +++ b/buildSrc/src/testKit/thirdPartyAudit/sample_jars/build.gradle @@ -1,52 +1,52 @@ plugins { - id 'java' + id 'java' } repositories { - mavenCentral() + mavenCentral() } dependencies { - compile 'org.apache.logging.log4j:log4j-core:2.11.1' + compile 'org.apache.logging.log4j:log4j-core:2.11.1' } // Tests have to clean mid-test but we don't want the sample jars to go away clean.enabled = false ["0.0.1", "0.0.2"].forEach { v -> - ["elasticsearch", "other"].forEach { p -> - task "dummy-${p}-${v}"(type: Jar) { - destinationDir = file("${buildDir}/testrepo/org/${p}/gradle/dummy-io/${v}/") - archiveName = "dummy-io-${v}.jar" - from sourceSets.main.output - include "**/TestingIO.class" - if (v == "0.0.2") { - manifest { - attributes( - "X-Different": "Different manifest, different jar" - ) - } - } + ["elasticsearch", "other"].forEach { p -> + task "dummy-${p}-${v}"(type: Jar) { + destinationDir = file("${buildDir}/testrepo/org/${p}/gradle/dummy-io/${v}/") + archiveName = "dummy-io-${v}.jar" + from sourceSets.main.output + include "**/TestingIO.class" + if (v == "0.0.2") { + manifest { + attributes( + "X-Different": "Different manifest, different jar" + ) } - build.dependsOn("dummy-${p}-${v}") + } } + build.dependsOn("dummy-${p}-${v}") + } } ["0.0.1"].forEach { v -> - ["elasticsearch", "other"].forEach { p -> - task "broken-log4j-${p}-${v}"(type: Jar) { - destinationDir = file("${buildDir}/testrepo/org/${p}/gradle/broken-log4j/${v}/") - archiveName = "broken-log4j-${v}.jar" - from sourceSets.main.output - include "**/TestingLog4j.class" - } - build.dependsOn("broken-log4j-${p}-${v}") + ["elasticsearch", "other"].forEach { p -> + task "broken-log4j-${p}-${v}"(type: Jar) { + destinationDir = file("${buildDir}/testrepo/org/${p}/gradle/broken-log4j/${v}/") + archiveName = "broken-log4j-${v}.jar" + from sourceSets.main.output + include "**/TestingLog4j.class" } + build.dependsOn("broken-log4j-${p}-${v}") + } } task jarhellJdk(type: Jar) { - destinationDir = file("${buildDir}/testrepo/org/other/gradle/jarhellJdk/0.0.1/") - archiveName = "jarhellJdk-0.0.1.jar" - from sourceSets.main.output - include "**/String.class" - into "java/lang" - build.dependsOn("jarhellJdk") -} \ No newline at end of file + destinationDir = file("${buildDir}/testrepo/org/other/gradle/jarhellJdk/0.0.1/") + archiveName = "jarhellJdk-0.0.1.jar" + from sourceSets.main.output + include "**/String.class" + into "java/lang" + build.dependsOn("jarhellJdk") +} diff --git a/client/rest-high-level/build.gradle b/client/rest-high-level/build.gradle index 497987b2c9e..d6817493a78 100644 --- a/client/rest-high-level/build.gradle +++ b/client/rest-high-level/build.gradle @@ -41,9 +41,9 @@ configurations { idea { module { - if (scopes.TEST != null) { - scopes.TEST.plus.add(project.configurations.restSpec) - } + if (scopes.TEST != null) { + scopes.TEST.plus.add(project.configurations.restSpec) + } } } @@ -65,7 +65,7 @@ dependencies { // Needed for serialization tests: // (In order to serialize a server side class to a client side class or the other way around) testCompile(project(':x-pack:plugin:core')) { - exclude group: 'org.elasticsearch', module: 'elasticsearch-rest-high-level-client' + exclude group: 'org.elasticsearch', module: 'elasticsearch-rest-high-level-client' } restSpec project(':rest-api-spec') @@ -136,8 +136,8 @@ testClusters.all { keystore 'xpack.security.transport.ssl.truststore.secure_password', 'testnode' extraConfigFile 'roles.yml', file('roles.yml') user username: System.getProperty('tests.rest.cluster.username', 'test_user'), - password: System.getProperty('tests.rest.cluster.password', 'test-password'), - role: System.getProperty('tests.rest.cluster.role', 'admin') + password: System.getProperty('tests.rest.cluster.password', 'test-password'), + role: System.getProperty('tests.rest.cluster.role', 'admin') user username: 'admin_user', password: 'admin-password' extraConfigFile nodeCert.name, nodeCert diff --git a/client/rest/build.gradle b/client/rest/build.gradle index 352b15699d0..be48321be12 100644 --- a/client/rest/build.gradle +++ b/client/rest/build.gradle @@ -54,7 +54,7 @@ dependencies { tasks.withType(CheckForbiddenApis) { //client does not depend on server, so only jdk and http signatures should be checked - replaceSignatureFiles ('jdk-signatures', 'http-signatures') + replaceSignatureFiles('jdk-signatures', 'http-signatures') } forbiddenPatterns { @@ -69,7 +69,7 @@ forbiddenApisTest { // JarHell is part of es server, which we don't want to pull in // TODO: Not anymore. Now in :libs:elasticsearch-core -jarHell.enabled=false +jarHell.enabled = false testingConventions { naming.clear() @@ -80,7 +80,7 @@ testingConventions { } } -thirdPartyAudit.ignoreMissingClasses ( +thirdPartyAudit.ignoreMissingClasses( //commons-logging optional dependencies 'org.apache.avalon.framework.logger.Logger', 'org.apache.log.Hierarchy', diff --git a/client/sniffer/build.gradle b/client/sniffer/build.gradle index 8b4d21537a1..a0bea7a7b69 100644 --- a/client/sniffer/build.gradle +++ b/client/sniffer/build.gradle @@ -69,7 +69,7 @@ dependencyLicenses { // JarHell is part of es server, which we don't want to pull in // TODO: Not anymore. Now in :libs:elasticsearch-core -jarHell.enabled=false +jarHell.enabled = false testingConventions { naming.clear() @@ -87,7 +87,7 @@ dependencyLicenses { } } -thirdPartyAudit.ignoreMissingClasses ( +thirdPartyAudit.ignoreMissingClasses( //commons-logging optional dependencies 'org.apache.avalon.framework.logger.Logger', 'org.apache.log.Hierarchy', diff --git a/client/test/build.gradle b/client/test/build.gradle index 169172736ec..a863bf7c311 100644 --- a/client/test/build.gradle +++ b/client/test/build.gradle @@ -45,7 +45,7 @@ forbiddenApisTest { // JarHell is part of es server, which we don't want to pull in // TODO: Not anymore. Now in :libs:elasticsearch-core -jarHell.enabled=false +jarHell.enabled = false // TODO: should we have licenses for our test deps? dependencyLicenses.enabled = false diff --git a/distribution/archives/build.gradle b/distribution/archives/build.gradle index 96171bb280d..ed47971ef59 100644 --- a/distribution/archives/build.gradle +++ b/distribution/archives/build.gradle @@ -29,6 +29,7 @@ import org.elasticsearch.gradle.tar.SymbolicLinkPreservingTar import java.nio.file.Files import java.nio.file.Path + // need this so Zip/Tar tasks get basic defaults... apply plugin: 'base' @@ -40,7 +41,7 @@ task createLogsDir(type: EmptyDirTask) { dir = "${logsDir}" dirMode = 0755 } -ext.pluginsDir= new File(buildDir, 'plugins-hack/plugins') +ext.pluginsDir = new File(buildDir, 'plugins-hack/plugins') task createPluginsDir(type: EmptyDirTask) { dir = "${pluginsDir}" dirMode = 0755 diff --git a/distribution/archives/integ-test-zip/build.gradle b/distribution/archives/integ-test-zip/build.gradle index 13a0145bdbc..ed8f893d7f8 100644 --- a/distribution/archives/integ-test-zip/build.gradle +++ b/distribution/archives/integ-test-zip/build.gradle @@ -27,7 +27,7 @@ integTest.runner { */ if (System.getProperty("tests.rest.cluster") == null) { nonInputProperties.systemProperty 'tests.logfile', - "${ -> testClusters.integTest.singleNode().getServerLog()}" + "${-> testClusters.integTest.singleNode().getServerLog()}" } else { systemProperty 'tests.logfile', '--external--' } diff --git a/distribution/build.gradle b/distribution/build.gradle index bcb09c1bb86..221f639769e 100644 --- a/distribution/build.gradle +++ b/distribution/build.gradle @@ -36,9 +36,9 @@ apply plugin: 'elasticsearch.testclusters' // Concatenates the dependencies CSV files into a single file task generateDependenciesReport(type: ConcatFilesTask) { - files = fileTree(dir: project.rootDir, include: '**/dependencies.csv' ) + files = fileTree(dir: project.rootDir, include: '**/dependencies.csv') headerLine = "name,version,url,license" - target = new File(System.getProperty('csv')?: "${project.buildDir}/reports/dependencies/es-dependencies.csv") + target = new File(System.getProperty('csv') ?: "${project.buildDir}/reports/dependencies/es-dependencies.csv") } /***************************************************************************** @@ -138,7 +138,7 @@ void copyModule(Sync copyTask, Project module) { exclude 'config/log4j2.properties' eachFile { details -> - String name = module.plugins.hasPlugin('elasticsearch.esplugin') ? module.esplugin.name : module.es_meta_plugin.name + String name = module.plugins.hasPlugin('elasticsearch.esplugin') ? module.esplugin.name : module.es_meta_plugin.name // Copy all non config/bin files // Note these might be unde a subdirectory in the case of a meta plugin if ((details.relativePath.pathString ==~ /([^\/]+\/)?(config|bin)\/.*/) == false) { @@ -228,7 +228,7 @@ Project xpack = project(':x-pack:plugin') xpack.subprojects.findAll { it.parent == xpack }.each { Project xpackModule -> File licenses = new File(xpackModule.projectDir, 'licenses') if (licenses.exists()) { - buildDefaultNotice.licensesDir licenses + buildDefaultNotice.licensesDir licenses } copyModule(processDefaultOutputs, xpackModule) copyLog4jProperties(buildDefaultLog4jConfig, xpackModule) @@ -295,9 +295,9 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) { } List excludePlatforms = ['linux', 'windows', 'darwin'] if (platform != null) { - excludePlatforms.remove(excludePlatforms.indexOf(platform)) + excludePlatforms.remove(excludePlatforms.indexOf(platform)) } else { - excludePlatforms = [] + excludePlatforms = [] } from(buildModules) { for (String excludePlatform : excludePlatforms) { @@ -334,7 +334,7 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) { binFiles = { distributionType, oss, jdk -> copySpec { - // non-windows files, for all distributions + // non-windows files, for all distributions with copySpec { from '../src/bin' exclude '*.exe' @@ -384,7 +384,7 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) { } else { from buildDefaultNoJdkNotice } - } + } } } @@ -485,10 +485,10 @@ subprojects { licenseText = rootProject.file('licenses/ELASTIC-LICENSE.txt').getText('UTF-8') } // license text needs to be indented with a single space - licenseText = ' ' + licenseText.replace('\n', '\n ') + licenseText = ' ' + licenseText.replace('\n', '\n ') String footer = "# Built for ${project.name}-${project.version} " + - "(${distributionType})" + "(${distributionType})" Map expansions = [ 'project.name': project.name, 'project.version': version, @@ -511,9 +511,9 @@ subprojects { 'def': 'if [ -z "$ES_PATH_CONF" ]; then ES_PATH_CONF="$ES_HOME"/config; done', ], 'source.path.env': [ - 'deb': 'source /etc/default/elasticsearch', - 'rpm': 'source /etc/sysconfig/elasticsearch', - 'def': 'if [ -z "$ES_PATH_CONF" ]; then ES_PATH_CONF="$ES_HOME"/config; fi', + 'deb': 'source /etc/default/elasticsearch', + 'rpm': 'source /etc/sysconfig/elasticsearch', + 'def': 'if [ -z "$ES_PATH_CONF" ]; then ES_PATH_CONF="$ES_HOME"/config; fi', ], 'path.logs': [ 'deb': packagingPathLogs, @@ -590,7 +590,7 @@ subprojects { return result } - ext.assertLinesInFile = { Path path, List expectedLines -> + ext.assertLinesInFile = { Path path, List expectedLines -> final List actualLines = Files.readAllLines(path) int line = 0 for (final String expectedLine : expectedLines) { @@ -603,12 +603,12 @@ subprojects { } } -['archives:windows-zip','archives:oss-windows-zip', - 'archives:darwin-tar','archives:oss-darwin-tar', - 'archives:linux-tar', 'archives:oss-linux-tar', - 'archives:integ-test-zip', - 'packages:rpm', 'packages:deb', - 'packages:oss-rpm', 'packages:oss-deb', +['archives:windows-zip', 'archives:oss-windows-zip', + 'archives:darwin-tar', 'archives:oss-darwin-tar', + 'archives:linux-tar', 'archives:oss-linux-tar', + 'archives:integ-test-zip', + 'packages:rpm', 'packages:deb', + 'packages:oss-rpm', 'packages:oss-deb', ].forEach { subName -> Project subproject = project("${project.path}:${subName}") Configuration configuration = configurations.create(subproject.name) diff --git a/distribution/bwc/build.gradle b/distribution/bwc/build.gradle index 9666c4111a2..e96ee75ae43 100644 --- a/distribution/bwc/build.gradle +++ b/distribution/bwc/build.gradle @@ -35,7 +35,8 @@ import static org.elasticsearch.gradle.BuildPlugin.getJavaHome * unreleased versions are when Gradle projects are set up, so we use "build-unreleased-version-*" as placeholders * and configure them to build various versions here. */ -bwcVersions.forPreviousUnreleased { BwcVersions.UnreleasedVersionInfo unreleasedVersion -> project("${unreleasedVersion.gradleProjectPath}") { +bwcVersions.forPreviousUnreleased { BwcVersions.UnreleasedVersionInfo unreleasedVersion -> + project("${unreleasedVersion.gradleProjectPath}") { Version bwcVersion = unreleasedVersion.version String bwcBranch = unreleasedVersion.branch apply plugin: 'distribution' @@ -49,196 +50,196 @@ bwcVersions.forPreviousUnreleased { BwcVersions.UnreleasedVersionInfo unreleased boolean gitFetchLatest final String gitFetchLatestProperty = System.getProperty("tests.bwc.git_fetch_latest", "true") if ("true".equals(gitFetchLatestProperty)) { - gitFetchLatest = true + gitFetchLatest = true } else if ("false".equals(gitFetchLatestProperty)) { - gitFetchLatest = false + gitFetchLatest = false } else { - throw new GradleException("tests.bwc.git_fetch_latest must be [true] or [false] but was [" + gitFetchLatestProperty + "]") + throw new GradleException("tests.bwc.git_fetch_latest must be [true] or [false] but was [" + gitFetchLatestProperty + "]") } task createClone(type: LoggedExec) { - onlyIf { checkoutDir.exists() == false } - commandLine = ['git', 'clone', rootDir, checkoutDir] + onlyIf { checkoutDir.exists() == false } + commandLine = ['git', 'clone', rootDir, checkoutDir] } task findRemote(type: LoggedExec) { - dependsOn createClone - workingDir = checkoutDir - commandLine = ['git', 'remote', '-v'] - ByteArrayOutputStream output = new ByteArrayOutputStream() - standardOutput = output - doLast { - project.ext.remoteExists = false - output.toString('UTF-8').eachLine { - if (it.contains("${remote}\t")) { - project.ext.remoteExists = true - } - } + dependsOn createClone + workingDir = checkoutDir + commandLine = ['git', 'remote', '-v'] + ByteArrayOutputStream output = new ByteArrayOutputStream() + standardOutput = output + doLast { + project.ext.remoteExists = false + output.toString('UTF-8').eachLine { + if (it.contains("${remote}\t")) { + project.ext.remoteExists = true + } } + } } task addRemote(type: LoggedExec) { - dependsOn findRemote - onlyIf { project.ext.remoteExists == false } - workingDir = checkoutDir - commandLine = ['git', 'remote', 'add', "${remote}", "https://github.com/${remote}/elasticsearch.git"] + dependsOn findRemote + onlyIf { project.ext.remoteExists == false } + workingDir = checkoutDir + commandLine = ['git', 'remote', 'add', "${remote}", "https://github.com/${remote}/elasticsearch.git"] } task fetchLatest(type: LoggedExec) { - onlyIf { project.gradle.startParameter.isOffline() == false && gitFetchLatest } - dependsOn addRemote - workingDir = checkoutDir - commandLine = ['git', 'fetch', '--all'] + onlyIf { project.gradle.startParameter.isOffline() == false && gitFetchLatest } + dependsOn addRemote + workingDir = checkoutDir + commandLine = ['git', 'fetch', '--all'] } - Closure execGit = { Action action -> - new ByteArrayOutputStream().withStream { os -> - ExecResult result = project.exec { spec -> - workingDir = checkoutDir - standardOutput os - action.execute(spec) - } - result.assertNormalExitValue() - return os.toString().trim() + Closure execGit = { Action action -> + new ByteArrayOutputStream().withStream { os -> + ExecResult result = project.exec { spec -> + workingDir = checkoutDir + standardOutput os + action.execute(spec) } + result.assertNormalExitValue() + return os.toString().trim() + } } task checkoutBwcBranch() { - dependsOn fetchLatest - doLast { - String refspec = System.getProperty("bwc.refspec.${bwcBranch}") ?: System.getProperty("tests.bwc.refspec.${bwcBranch}") ?: "${remote}/${bwcBranch}" - if (System.getProperty("bwc.checkout.align") != null) { - /* - We use a time based approach to make the bwc versions built deterministic and compatible with the current hash. - Most of the time we want to test against latest, but when running delayed exhaustive tests or wanting - reproducible builds we want this to be deterministic by using a hash that was the latest when the current - commit was made. + dependsOn fetchLatest + doLast { + String refspec = System.getProperty("bwc.refspec.${bwcBranch}") ?: System.getProperty("tests.bwc.refspec.${bwcBranch}") ?: "${remote}/${bwcBranch}" + if (System.getProperty("bwc.checkout.align") != null) { + /* + We use a time based approach to make the bwc versions built deterministic and compatible with the current hash. + Most of the time we want to test against latest, but when running delayed exhaustive tests or wanting + reproducible builds we want this to be deterministic by using a hash that was the latest when the current + commit was made. - This approach doesn't work with merge commits as these can introduce commits in the chronological order - after the fact e.x. a merge done today can add commits dated with yesterday so the result will no longer be - deterministic. + This approach doesn't work with merge commits as these can introduce commits in the chronological order + after the fact e.x. a merge done today can add commits dated with yesterday so the result will no longer be + deterministic. - We don't use merge commits, but for additional safety we check that no such commits exist in the time period - we are interested in. + We don't use merge commits, but for additional safety we check that no such commits exist in the time period + we are interested in. - Timestamps are at seconds resolution. rev-parse --before and --after are inclusive w.r.t the second - passed as input. This means the results might not be deterministic in the current second, but this - should not matter in practice. - */ - String timeOfCurrent = execGit { spec -> - spec.commandLine 'git', 'show', '--no-patch', '--no-notes', "--pretty='%cD'" - spec.workingDir project.rootDir - } - logger.lifecycle("Commit date of current: {}", timeOfCurrent) - String mergeCommits = execGit { spec -> - spec.commandLine "git", "rev-list", refspec, "--after", timeOfCurrent, "--merges" - } - if (mergeCommits.isEmpty() == false) { - throw new IllegalStateException( - "Found the following merge commits which prevent determining bwc commits: " + mergeCommits - ) - } - refspec = execGit { spec -> - spec.commandLine "git", "rev-list", refspec, "-n", "1", "--before", timeOfCurrent, "--date-order" - } - } - - logger.lifecycle("Performing checkout of ${refspec}...") - LoggedExec.exec(project) { spec -> - spec.workingDir = checkoutDir - spec.commandLine "git", "checkout", refspec - } - String checkoutHash = GlobalBuildInfoPlugin.gitRevision(checkoutDir) - logger.lifecycle("Checkout hash for ${project.path} is ${checkoutHash}") - file("${project.buildDir}/refspec").text = checkoutHash + Timestamps are at seconds resolution. rev-parse --before and --after are inclusive w.r.t the second + passed as input. This means the results might not be deterministic in the current second, but this + should not matter in practice. + */ + String timeOfCurrent = execGit { spec -> + spec.commandLine 'git', 'show', '--no-patch', '--no-notes', "--pretty='%cD'" + spec.workingDir project.rootDir + } + logger.lifecycle("Commit date of current: {}", timeOfCurrent) + String mergeCommits = execGit { spec -> + spec.commandLine "git", "rev-list", refspec, "--after", timeOfCurrent, "--merges" + } + if (mergeCommits.isEmpty() == false) { + throw new IllegalStateException( + "Found the following merge commits which prevent determining bwc commits: " + mergeCommits + ) + } + refspec = execGit { spec -> + spec.commandLine "git", "rev-list", refspec, "-n", "1", "--before", timeOfCurrent, "--date-order" + } } + + logger.lifecycle("Performing checkout of ${refspec}...") + LoggedExec.exec(project) { spec -> + spec.workingDir = checkoutDir + spec.commandLine "git", "checkout", refspec + } + String checkoutHash = GlobalBuildInfoPlugin.gitRevision(checkoutDir) + logger.lifecycle("Checkout hash for ${project.path} is ${checkoutHash}") + file("${project.buildDir}/refspec").text = checkoutHash + } } Closure createRunBwcGradleTask = { name, extraConfig -> - return tasks.create(name: "$name", type: LoggedExec) { - dependsOn checkoutBwcBranch - spoolOutput = true - workingDir = checkoutDir - doFirst { - // Execution time so that the checkouts are available - List lines = file("${checkoutDir}/.ci/java-versions.properties").readLines() - environment( - 'JAVA_HOME', - getJavaHome(it, Integer.parseInt( - lines - .findAll({ it.startsWith("ES_BUILD_JAVA=") }) - .collect({ it.replace("ES_BUILD_JAVA=java", "").trim() }) - .collect({ it.replace("ES_BUILD_JAVA=openjdk", "").trim() }) - .join("!!") - )) - ) - environment( - 'RUNTIME_JAVA_HOME', - getJavaHome(it, Integer.parseInt( - lines - .findAll({ it.startsWith("ES_RUNTIME_JAVA=java") }) - .collect({ it.replace("ES_RUNTIME_JAVA=java", "").trim() }) - .join("!!") - )) - ) - } - - if (Os.isFamily(Os.FAMILY_WINDOWS)) { - executable 'cmd' - args '/C', 'call', new File(checkoutDir, 'gradlew').toString() - } else { - executable new File(checkoutDir, 'gradlew').toString() - } - if (gradle.startParameter.isOffline()) { - args "--offline" - } - - args "-Dbuild.snapshot=true" - final LogLevel logLevel = gradle.startParameter.logLevel - if ([LogLevel.QUIET, LogLevel.WARN, LogLevel.INFO, LogLevel.DEBUG].contains(logLevel)) { - args "--${logLevel.name().toLowerCase(Locale.ENGLISH)}" - } - final String showStacktraceName = gradle.startParameter.showStacktrace.name() - assert ["INTERNAL_EXCEPTIONS", "ALWAYS", "ALWAYS_FULL"].contains(showStacktraceName) - if (showStacktraceName.equals("ALWAYS")) { - args "--stacktrace" - } else if (showStacktraceName.equals("ALWAYS_FULL")) { - args "--full-stacktrace" - } - if (gradle.getStartParameter().isParallelProjectExecutionEnabled()) { - args "--parallel" - } - standardOutput = new IndentingOutputStream(System.out, bwcVersion) - errorOutput = new IndentingOutputStream(System.err, bwcVersion) - configure extraConfig + return tasks.create(name: "$name", type: LoggedExec) { + dependsOn checkoutBwcBranch + spoolOutput = true + workingDir = checkoutDir + doFirst { + // Execution time so that the checkouts are available + List lines = file("${checkoutDir}/.ci/java-versions.properties").readLines() + environment( + 'JAVA_HOME', + getJavaHome(it, Integer.parseInt( + lines + .findAll({ it.startsWith("ES_BUILD_JAVA=") }) + .collect({ it.replace("ES_BUILD_JAVA=java", "").trim() }) + .collect({ it.replace("ES_BUILD_JAVA=openjdk", "").trim() }) + .join("!!") + )) + ) + environment( + 'RUNTIME_JAVA_HOME', + getJavaHome(it, Integer.parseInt( + lines + .findAll({ it.startsWith("ES_RUNTIME_JAVA=java") }) + .collect({ it.replace("ES_RUNTIME_JAVA=java", "").trim() }) + .join("!!") + )) + ) } + + if (Os.isFamily(Os.FAMILY_WINDOWS)) { + executable 'cmd' + args '/C', 'call', new File(checkoutDir, 'gradlew').toString() + } else { + executable new File(checkoutDir, 'gradlew').toString() + } + if (gradle.startParameter.isOffline()) { + args "--offline" + } + + args "-Dbuild.snapshot=true" + final LogLevel logLevel = gradle.startParameter.logLevel + if ([LogLevel.QUIET, LogLevel.WARN, LogLevel.INFO, LogLevel.DEBUG].contains(logLevel)) { + args "--${logLevel.name().toLowerCase(Locale.ENGLISH)}" + } + final String showStacktraceName = gradle.startParameter.showStacktrace.name() + assert ["INTERNAL_EXCEPTIONS", "ALWAYS", "ALWAYS_FULL"].contains(showStacktraceName) + if (showStacktraceName.equals("ALWAYS")) { + args "--stacktrace" + } else if (showStacktraceName.equals("ALWAYS_FULL")) { + args "--full-stacktrace" + } + if (gradle.getStartParameter().isParallelProjectExecutionEnabled()) { + args "--parallel" + } + standardOutput = new IndentingOutputStream(System.out, bwcVersion) + errorOutput = new IndentingOutputStream(System.err, bwcVersion) + configure extraConfig + } } - Closure buildBwcTaskName = { projectName -> - return "buildBwc${projectName.replaceAll(/-\w/){ it[1].toUpperCase() }.capitalize()}" + Closure buildBwcTaskName = { projectName -> + return "buildBwc${projectName.replaceAll(/-\w/) { it[1].toUpperCase() }.capitalize()}" } task buildBwc {} Closure createBuildBwcTask = { projectName, projectDir, projectArtifact -> - Task bwcTask = createRunBwcGradleTask(buildBwcTaskName(projectName)) { - inputs.file("${project.buildDir}/refspec") - outputs.files(projectArtifact) - outputs.cacheIf("BWC distribution caching is disabled on 'master' branch") { - // Don't bother caching in 'master' since the BWC branches move too quickly to make this cost worthwhile - BuildParams.ci && System.getenv('GIT_BRANCH')?.endsWith("master") == false - } - args ":${projectDir.replace('/', ':')}:assemble" - if (project.gradle.startParameter.buildCacheEnabled) { - args "--build-cache" - } - doLast { - if (projectArtifact.exists() == false) { - throw new InvalidUserDataException("Building ${bwcVersion} didn't generate expected file ${projectArtifact}") - } - } + Task bwcTask = createRunBwcGradleTask(buildBwcTaskName(projectName)) { + inputs.file("${project.buildDir}/refspec") + outputs.files(projectArtifact) + outputs.cacheIf("BWC distribution caching is disabled on 'master' branch") { + // Don't bother caching in 'master' since the BWC branches move too quickly to make this cost worthwhile + BuildParams.ci && System.getenv('GIT_BRANCH')?.endsWith("master") == false } - buildBwc.dependsOn bwcTask + args ":${projectDir.replace('/', ':')}:assemble" + if (project.gradle.startParameter.buildCacheEnabled) { + args "--build-cache" + } + doLast { + if (projectArtifact.exists() == false) { + throw new InvalidUserDataException("Building ${bwcVersion} didn't generate expected file ${projectArtifact}") + } + } + } + buildBwc.dependsOn bwcTask } Map artifactFiles = [:] @@ -251,90 +252,91 @@ bwcVersions.forPreviousUnreleased { BwcVersions.UnreleasedVersionInfo unreleased } for (String projectName : projects) { - String baseDir = "distribution" - String classifier = "" - String extension = projectName - if (bwcVersion.onOrAfter('7.0.0') && (projectName.contains('zip') || projectName.contains('tar'))) { - int index = projectName.indexOf('-') - classifier = "-${projectName.substring(0, index)}-x86_64" - extension = projectName.substring(index + 1) - if (extension.equals('tar')) { - extension += '.gz' - } + String baseDir = "distribution" + String classifier = "" + String extension = projectName + if (bwcVersion.onOrAfter('7.0.0') && (projectName.contains('zip') || projectName.contains('tar'))) { + int index = projectName.indexOf('-') + classifier = "-${projectName.substring(0, index)}-x86_64" + extension = projectName.substring(index + 1) + if (extension.equals('tar')) { + extension += '.gz' } - if (bwcVersion.onOrAfter('7.0.0') && projectName.contains('deb')) { - classifier = "-amd64" - } - if (bwcVersion.onOrAfter('7.0.0') && projectName.contains('rpm')) { - classifier = "-x86_64" - } - if (bwcVersion.onOrAfter('6.3.0')) { - baseDir += projectName.endsWith('zip') || projectName.endsWith('tar') ? '/archives' : '/packages' - // add oss variant first - projectDirs.add("${baseDir}/oss-${projectName}") - File ossProjectArtifact = file("${checkoutDir}/${baseDir}/oss-${projectName}/build/distributions/elasticsearch-oss-${bwcVersion}-SNAPSHOT${classifier}.${extension}") - artifactFiles.put("oss-" + projectName, ossProjectArtifact) - createBuildBwcTask("oss-${projectName}", "${baseDir}/oss-${projectName}", ossProjectArtifact) - } - projectDirs.add("${baseDir}/${projectName}") - File projectArtifact = file("${checkoutDir}/${baseDir}/${projectName}/build/distributions/elasticsearch-${bwcVersion}-SNAPSHOT${classifier}.${extension}") - artifactFiles.put(projectName, projectArtifact) - - createBuildBwcTask(projectName, "${baseDir}/${projectName}", projectArtifact) + } + if (bwcVersion.onOrAfter('7.0.0') && projectName.contains('deb')) { + classifier = "-amd64" + } + if (bwcVersion.onOrAfter('7.0.0') && projectName.contains('rpm')) { + classifier = "-x86_64" + } + if (bwcVersion.onOrAfter('6.3.0')) { + baseDir += projectName.endsWith('zip') || projectName.endsWith('tar') ? '/archives' : '/packages' + // add oss variant first + projectDirs.add("${baseDir}/oss-${projectName}") + File ossProjectArtifact = file("${checkoutDir}/${baseDir}/oss-${projectName}/build/distributions/elasticsearch-oss-${bwcVersion}-SNAPSHOT${classifier}.${extension}") + artifactFiles.put("oss-" + projectName, ossProjectArtifact) + createBuildBwcTask("oss-${projectName}", "${baseDir}/oss-${projectName}", ossProjectArtifact) + } + projectDirs.add("${baseDir}/${projectName}") + File projectArtifact = file("${checkoutDir}/${baseDir}/${projectName}/build/distributions/elasticsearch-${bwcVersion}-SNAPSHOT${classifier}.${extension}") + artifactFiles.put(projectName, projectArtifact) + + createBuildBwcTask(projectName, "${baseDir}/${projectName}", projectArtifact) } createRunBwcGradleTask("resolveAllBwcDependencies") { - args 'resolveAllDependencies' + args 'resolveAllDependencies' } Version currentVersion = Version.fromString(version) if (currentVersion.getMinor() == 0 && currentVersion.getRevision() == 0) { - // We only want to resolve dependencies for live versions of master, without cascading this to older versions - resolveAllDependencies.dependsOn resolveAllBwcDependencies + // We only want to resolve dependencies for live versions of master, without cascading this to older versions + resolveAllDependencies.dependsOn resolveAllBwcDependencies } for (e in artifactFiles) { - String projectName = e.key - String buildBwcTask = buildBwcTaskName(projectName) - File artifactFile = e.value - String artifactFileName = artifactFile.name - String artifactName = artifactFileName.contains('oss') ? 'elasticsearch-oss' : 'elasticsearch' - String suffix = artifactFile.toString()[-3..-1] - int archIndex = artifactFileName.indexOf('x86_64') - String classifier = '' - if (archIndex != -1) { - int osIndex = artifactFileName.lastIndexOf('-', archIndex - 2) - classifier = "${artifactFileName.substring(osIndex + 1, archIndex - 1)}-x86_64" - } - configurations.create(projectName) - artifacts { - it.add(projectName, [file: artifactFile, name: artifactName, classifier: classifier, type: suffix, builtBy: buildBwcTask]) - } + String projectName = e.key + String buildBwcTask = buildBwcTaskName(projectName) + File artifactFile = e.value + String artifactFileName = artifactFile.name + String artifactName = artifactFileName.contains('oss') ? 'elasticsearch-oss' : 'elasticsearch' + String suffix = artifactFile.toString()[-3..-1] + int archIndex = artifactFileName.indexOf('x86_64') + String classifier = '' + if (archIndex != -1) { + int osIndex = artifactFileName.lastIndexOf('-', archIndex - 2) + classifier = "${artifactFileName.substring(osIndex + 1, archIndex - 1)}-x86_64" + } + configurations.create(projectName) + artifacts { + it.add(projectName, [file: artifactFile, name: artifactName, classifier: classifier, type: suffix, builtBy: buildBwcTask]) + } } // make sure no dependencies were added to assemble; we want it to be a no-op assemble.dependsOn = [] -}} + } +} class IndentingOutputStream extends OutputStream { - public final byte[] indent - private final OutputStream delegate + public final byte[] indent + private final OutputStream delegate - public IndentingOutputStream(OutputStream delegate, Object version) { - this.delegate = delegate - indent = " [${version}] ".getBytes(StandardCharsets.UTF_8) - } + public IndentingOutputStream(OutputStream delegate, Object version) { + this.delegate = delegate + indent = " [${version}] ".getBytes(StandardCharsets.UTF_8) + } - @Override - public void write(int b) { - write([b] as int[], 0, 1) - } + @Override + public void write(int b) { + write([b] as int[], 0, 1) + } - public void write(int[] bytes, int offset, int length) { - for (int i = 0; i < bytes.length; i++) { - delegate.write(bytes[i]) - if (bytes[i] == '\n') { - delegate.write(indent) - } - } + public void write(int[] bytes, int offset, int length) { + for (int i = 0; i < bytes.length; i++) { + delegate.write(bytes[i]) + if (bytes[i] == '\n') { + delegate.write(indent) + } } + } } diff --git a/distribution/docker/build.gradle b/distribution/docker/build.gradle index 00a780a10f2..87af010d238 100644 --- a/distribution/docker/build.gradle +++ b/distribution/docker/build.gradle @@ -23,7 +23,7 @@ dependencies { } ext.expansions = { oss, ubi, local -> - final String classifier = 'linux-x86_64' + final String classifier = 'linux-x86_64' final String elasticsearch = oss ? "elasticsearch-oss-${VersionProperties.elasticsearch}-${classifier}.tar.gz" : "elasticsearch-${VersionProperties.elasticsearch}-${classifier}.tar.gz" return [ 'base_image' : ubi ? 'registry.access.redhat.com/ubi7/ubi-minimal:7.7' : 'centos:7', @@ -38,11 +38,11 @@ ext.expansions = { oss, ubi, local -> } private static String buildPath(final boolean oss, final boolean ubi) { - return "build/${ oss ? 'oss-' : ''}${ ubi ? 'ubi-' : ''}docker" + return "build/${oss ? 'oss-' : ''}${ubi ? 'ubi-' : ''}docker" } private static String taskName(final String prefix, final boolean oss, final boolean ubi, final String suffix) { - return "${prefix}${oss ? 'Oss' : ''}${ubi ? 'Ubi': ''}${suffix}" + return "${prefix}${oss ? 'Oss' : ''}${ubi ? 'Ubi' : ''}${suffix}" } project.ext { @@ -55,7 +55,7 @@ project.ext { into('config') { /* * Oss and default distribution can have different configuration, therefore we want to allow overriding the default configuration - * by creating config files in oss or default build-context sub-modules. + * by creating config files in oss or default build-context sub-modules. */ from project.projectDir.toPath().resolve("src/docker/config") if (oss) { @@ -89,7 +89,7 @@ void addCopyDockerContextTask(final boolean oss, final boolean ubi) { } } -def createAndSetWritable (Object... locations) { +def createAndSetWritable(Object... locations) { locations.each { location -> File file = file(location) file.mkdirs() @@ -99,7 +99,7 @@ def createAndSetWritable (Object... locations) { task copyKeystore(type: Sync) { from project(':x-pack:plugin:core') - .file('src/test/resources/org/elasticsearch/xpack/security/transport/ssl/certs/simple/testnode.jks') + .file('src/test/resources/org/elasticsearch/xpack/security/transport/ssl/certs/simple/testnode.jks') into "${buildDir}/certs" doLast { file("${buildDir}/certs").setReadable(true, false) @@ -115,26 +115,26 @@ preProcessFixture { doLast { // tests expect to have an empty repo project.delete( - "${buildDir}/repo", - "${buildDir}/oss-repo" + "${buildDir}/repo", + "${buildDir}/oss-repo" ) createAndSetWritable( - "${buildDir}/repo", - "${buildDir}/oss-repo", - "${buildDir}/logs/default-1", - "${buildDir}/logs/default-2", - "${buildDir}/logs/oss-1", - "${buildDir}/logs/oss-2" + "${buildDir}/repo", + "${buildDir}/oss-repo", + "${buildDir}/logs/default-1", + "${buildDir}/logs/default-2", + "${buildDir}/logs/oss-1", + "${buildDir}/logs/oss-2" ) } } processTestResources { - from ({ zipTree(configurations.restSpec.singleFile) }) { + from({ zipTree(configurations.restSpec.singleFile) }) { include 'rest-api-spec/api/**' } from project(':x-pack:plugin:core') - .file('src/test/resources/org/elasticsearch/xpack/security/transport/ssl/certs/simple/testnode.jks') + .file('src/test/resources/org/elasticsearch/xpack/security/transport/ssl/certs/simple/testnode.jks') dependsOn configurations.restSpec } @@ -154,7 +154,7 @@ void addBuildDockerImage(final boolean oss, final boolean ubi) { dependsOn taskName("copy", oss, ubi, "DockerContext") List tags if (oss) { - tags = [ + tags = [ "docker.elastic.co/elasticsearch/elasticsearch-oss${ubi ? '-ubi7' : ''}:${VersionProperties.elasticsearch}", "elasticsearch-oss${ubi ? '-ubi7' : ''}:test" ] @@ -186,10 +186,10 @@ for (final boolean oss : [false, true]) { } // We build the images used in compose locally, but the pull command insists on using a repository -// thus we must disable it to prevent it from doing so. +// thus we must disable it to prevent it from doing so. // Everything will still be pulled since we will build the local images on a pull if (tasks.findByName("composePull")) { - tasks.composePull.enabled = false + tasks.composePull.enabled = false } /* @@ -218,9 +218,9 @@ subprojects { Project subProject -> exportDockerImageTask.dependsOn(parent.tasks.getByName(buildTaskName)) artifacts.add('default', file(tarFile)) { - type 'tar' - name "elasticsearch${oss ? '-oss' : ''}${ubi ? '-ubi7' : ''}" - builtBy exportTaskName + type 'tar' + name "elasticsearch${oss ? '-oss' : ''}${ubi ? '-ubi7' : ''}" + builtBy exportTaskName } assemble.dependsOn exportTaskName diff --git a/distribution/docker/docker-build-context/build.gradle b/distribution/docker/docker-build-context/build.gradle index 63eba68e829..56c76befc68 100644 --- a/distribution/docker/docker-build-context/build.gradle +++ b/distribution/docker/docker-build-context/build.gradle @@ -1,11 +1,11 @@ apply plugin: 'base' task buildDockerBuildContext(type: Tar) { - extension = 'tar.gz' - compression = Compression.GZIP - archiveClassifier = "docker-build-context" - archiveBaseName = "elasticsearch" - with dockerBuildContext(false, false, false) + extension = 'tar.gz' + compression = Compression.GZIP + archiveClassifier = "docker-build-context" + archiveBaseName = "elasticsearch" + with dockerBuildContext(false, false, false) } assemble.dependsOn buildDockerBuildContext diff --git a/distribution/docker/oss-docker-build-context/build.gradle b/distribution/docker/oss-docker-build-context/build.gradle index 033348613b7..2910ed3f778 100644 --- a/distribution/docker/oss-docker-build-context/build.gradle +++ b/distribution/docker/oss-docker-build-context/build.gradle @@ -1,11 +1,11 @@ apply plugin: 'base' task buildOssDockerBuildContext(type: Tar) { - extension = 'tar.gz' - compression = Compression.GZIP - archiveClassifier = "docker-build-context" - archiveBaseName = "elasticsearch-oss" - with dockerBuildContext(true, false, false) + extension = 'tar.gz' + compression = Compression.GZIP + archiveClassifier = "docker-build-context" + archiveBaseName = "elasticsearch-oss" + with dockerBuildContext(true, false, false) } assemble.dependsOn buildOssDockerBuildContext diff --git a/distribution/docker/oss-ubi-docker-build-context/build.gradle b/distribution/docker/oss-ubi-docker-build-context/build.gradle index acae9f68d8e..b2b9685a822 100644 --- a/distribution/docker/oss-ubi-docker-build-context/build.gradle +++ b/distribution/docker/oss-ubi-docker-build-context/build.gradle @@ -1,11 +1,11 @@ apply plugin: 'base' task buildOssUbiDockerBuildContext(type: Tar) { - extension = 'tar.gz' - compression = Compression.GZIP - archiveClassifier = "docker-build-context" - archiveBaseName = "elasticsearch-oss-ubi7" - with dockerBuildContext(true, true, false) + extension = 'tar.gz' + compression = Compression.GZIP + archiveClassifier = "docker-build-context" + archiveBaseName = "elasticsearch-oss-ubi7" + with dockerBuildContext(true, true, false) } assemble.dependsOn buildOssUbiDockerBuildContext diff --git a/distribution/docker/ubi-docker-build-context/build.gradle b/distribution/docker/ubi-docker-build-context/build.gradle index 941bb0c89fc..e59e4ddc9ab 100644 --- a/distribution/docker/ubi-docker-build-context/build.gradle +++ b/distribution/docker/ubi-docker-build-context/build.gradle @@ -1,11 +1,11 @@ apply plugin: 'base' task buildUbiDockerBuildContext(type: Tar) { - extension = 'tar.gz' - compression = Compression.GZIP - archiveClassifier = "docker-build-context" - archiveBaseName = "elasticsearch-ubi7" - with dockerBuildContext(false, true, false) + extension = 'tar.gz' + compression = Compression.GZIP + archiveClassifier = "docker-build-context" + archiveBaseName = "elasticsearch-ubi7" + with dockerBuildContext(false, true, false) } assemble.dependsOn buildUbiDockerBuildContext diff --git a/distribution/packages/build.gradle b/distribution/packages/build.gradle index 25c50c0fa73..695654bca34 100644 --- a/distribution/packages/build.gradle +++ b/distribution/packages/build.gradle @@ -92,6 +92,7 @@ void addProcessFilesTask(String type, boolean oss, boolean jdk) { } } } + addProcessFilesTask('deb', true, true) addProcessFilesTask('deb', true, false) addProcessFilesTask('deb', false, true) @@ -111,7 +112,7 @@ Closure commonPackageConfig(String type, boolean oss, boolean jdk) { } dependsOn "process${oss ? 'Oss' : ''}${jdk ? '' : 'NoJdk'}${type.capitalize()}Files" packageName "elasticsearch${oss ? '-oss' : ''}" - arch (type == 'deb' ? 'amd64' : 'X86_64') + arch(type == 'deb' ? 'amd64' : 'X86_64') // Follow elasticsearch's file naming convention String jdkString = jdk ? "" : "no-jdk-" archiveName "${packageName}-${project.version}-${jdkString}${archString}.${type}" @@ -193,16 +194,16 @@ Closure commonPackageConfig(String type, boolean oss, boolean jdk) { configurationFile '/etc/elasticsearch/users' configurationFile '/etc/elasticsearch/users_roles' } - from("${packagingFiles}") { - dirMode 02750 - into('/etc') - permissionGroup 'elasticsearch' - includeEmptyDirs true - createDirectoryEntry true - include("elasticsearch") // empty dir, just to add directory entry - } - from("${packagingFiles}/etc/elasticsearch") { - into('/etc/elasticsearch') + from("${packagingFiles}") { + dirMode 02750 + into('/etc') + permissionGroup 'elasticsearch' + includeEmptyDirs true + createDirectoryEntry true + include("elasticsearch") // empty dir, just to add directory entry + } + from("${packagingFiles}/etc/elasticsearch") { + into('/etc/elasticsearch') dirMode 02750 fileMode 0660 permissionGroup 'elasticsearch' @@ -288,8 +289,8 @@ ospackage { signingKeyId = project.hasProperty('signing.keyId') ? project.property('signing.keyId') : 'D88E42B4' signingKeyPassphrase = project.property('signing.password') signingKeyRingFile = project.hasProperty('signing.secretKeyRingFile') ? - project.file(project.property('signing.secretKeyRingFile')) : - new File(new File(System.getProperty('user.home'), '.gnupg'), 'secring.gpg') + project.file(project.property('signing.secretKeyRingFile')) : + new File(new File(System.getProperty('user.home'), '.gnupg'), 'secring.gpg') } // version found on oldest supported distro, centos-6 @@ -442,16 +443,16 @@ subprojects { onlyIf rpmExists final File rpmDatabase = new File(extractionDir, 'rpm-database') commandLine 'rpm', - '--badreloc', - '--nodeps', - '--noscripts', - '--notriggers', - '--dbpath', - rpmDatabase, - '--relocate', - "/=${packageExtractionDir}", - '-i', - "${-> buildDist.outputs.files.singleFile}" + '--badreloc', + '--nodeps', + '--noscripts', + '--notriggers', + '--dbpath', + rpmDatabase, + '--relocate', + "/=${packageExtractionDir}", + '-i', + "${-> buildDist.outputs.files.singleFile}" } } @@ -476,8 +477,8 @@ subprojects { licenseFilename = "ELASTIC-LICENSE.txt" } final List header = Arrays.asList("Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/", - "Copyright: Elasticsearch B.V. ", - "License: " + expectedLicense) + "Copyright: Elasticsearch B.V. ", + "License: " + expectedLicense) final List licenseLines = Files.readAllLines(rootDir.toPath().resolve("licenses/" + licenseFilename)) final List expectedLines = header + licenseLines.collect { " " + it } assertLinesInFile(copyrightPath, expectedLines) diff --git a/distribution/tools/java-version-checker/build.gradle b/distribution/tools/java-version-checker/build.gradle index c8fe9e11219..e9ac7cfa287 100644 --- a/distribution/tools/java-version-checker/build.gradle +++ b/distribution/tools/java-version-checker/build.gradle @@ -4,7 +4,7 @@ targetCompatibility = JavaVersion.VERSION_1_7 // java_version_checker do not depend on core so only JDK signatures should be checked forbiddenApisMain { - replaceSignatureFiles 'jdk-signatures' + replaceSignatureFiles 'jdk-signatures' } test.enabled = false diff --git a/distribution/tools/launchers/build.gradle b/distribution/tools/launchers/build.gradle index e60902cc591..4b1fdf668ae 100644 --- a/distribution/tools/launchers/build.gradle +++ b/distribution/tools/launchers/build.gradle @@ -21,25 +21,25 @@ import de.thetaphi.forbiddenapis.gradle.CheckForbiddenApis apply plugin: 'elasticsearch.build' dependencies { - compile parent.project('java-version-checker') - testCompile "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${versions.randomizedrunner}" - testCompile "junit:junit:${versions.junit}" - testCompile "org.hamcrest:hamcrest:${versions.hamcrest}" + compile parent.project('java-version-checker') + testCompile "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${versions.randomizedrunner}" + testCompile "junit:junit:${versions.junit}" + testCompile "org.hamcrest:hamcrest:${versions.hamcrest}" } archivesBaseName = 'elasticsearch-launchers' tasks.withType(CheckForbiddenApis) { - replaceSignatureFiles 'jdk-signatures' + replaceSignatureFiles 'jdk-signatures' } testingConventions { - naming.clear() - naming { - Tests { - baseClass 'org.elasticsearch.tools.launchers.LaunchersTestCase' - } + naming.clear() + naming { + Tests { + baseClass 'org.elasticsearch.tools.launchers.LaunchersTestCase' } + } } javadoc.enabled = false diff --git a/distribution/tools/plugin-cli/build.gradle b/distribution/tools/plugin-cli/build.gradle index 700138bb24d..58341612162 100644 --- a/distribution/tools/plugin-cli/build.gradle +++ b/distribution/tools/plugin-cli/build.gradle @@ -45,7 +45,7 @@ test { thirdPartyAudit.onlyIf { // FIPS JVM includes manny classes from bouncycastle which count as jar hell for the third party audit, // rather than provide a long list of exclusions, disable the check on FIPS. - BuildParams.inFipsJvm + BuildParams.inFipsJvm } /* @@ -61,14 +61,14 @@ thirdPartyAudit.onlyIf { * */ thirdPartyAudit.ignoreViolations( - 'org.bouncycastle.jcajce.provider.BouncyCastleFipsProvider$CoreSecureRandom', - 'org.bouncycastle.jcajce.provider.ProvSunTLSKDF', - 'org.bouncycastle.jcajce.provider.ProvSunTLSKDF$BaseTLSKeyGeneratorSpi', - 'org.bouncycastle.jcajce.provider.ProvSunTLSKDF$TLSKeyMaterialGenerator', - 'org.bouncycastle.jcajce.provider.ProvSunTLSKDF$TLSKeyMaterialGenerator$2', - 'org.bouncycastle.jcajce.provider.ProvSunTLSKDF$TLSMasterSecretGenerator', - 'org.bouncycastle.jcajce.provider.ProvSunTLSKDF$TLSMasterSecretGenerator$2', - 'org.bouncycastle.jcajce.provider.ProvSunTLSKDF$TLSPRFKeyGenerator', - 'org.bouncycastle.jcajce.provider.ProvSunTLSKDF$TLSRsaPreMasterSecretGenerator', - 'org.bouncycastle.jcajce.provider.ProvSunTLSKDF$TLSRsaPreMasterSecretGenerator$2' + 'org.bouncycastle.jcajce.provider.BouncyCastleFipsProvider$CoreSecureRandom', + 'org.bouncycastle.jcajce.provider.ProvSunTLSKDF', + 'org.bouncycastle.jcajce.provider.ProvSunTLSKDF$BaseTLSKeyGeneratorSpi', + 'org.bouncycastle.jcajce.provider.ProvSunTLSKDF$TLSKeyMaterialGenerator', + 'org.bouncycastle.jcajce.provider.ProvSunTLSKDF$TLSKeyMaterialGenerator$2', + 'org.bouncycastle.jcajce.provider.ProvSunTLSKDF$TLSMasterSecretGenerator', + 'org.bouncycastle.jcajce.provider.ProvSunTLSKDF$TLSMasterSecretGenerator$2', + 'org.bouncycastle.jcajce.provider.ProvSunTLSKDF$TLSPRFKeyGenerator', + 'org.bouncycastle.jcajce.provider.ProvSunTLSKDF$TLSRsaPreMasterSecretGenerator', + 'org.bouncycastle.jcajce.provider.ProvSunTLSKDF$TLSRsaPreMasterSecretGenerator$2' ) diff --git a/docs/build.gradle b/docs/build.gradle index 5b499b19af2..597e304cc54 100644 --- a/docs/build.gradle +++ b/docs/build.gradle @@ -23,18 +23,18 @@ apply plugin: 'elasticsearch.docs-test' /* List of files that have snippets that will not work until platinum tests can occur ... */ buildRestTests.expectedUnconvertedCandidates = [ - 'reference/ml/anomaly-detection/transforms.asciidoc', - 'reference/ml/anomaly-detection/apis/delete-calendar-event.asciidoc', - 'reference/ml/anomaly-detection/apis/get-bucket.asciidoc', - 'reference/ml/anomaly-detection/apis/get-category.asciidoc', - 'reference/ml/anomaly-detection/apis/get-influencer.asciidoc', - 'reference/ml/anomaly-detection/apis/get-job-stats.asciidoc', - 'reference/ml/anomaly-detection/apis/get-overall-buckets.asciidoc', - 'reference/ml/anomaly-detection/apis/get-record.asciidoc', - 'reference/ml/anomaly-detection/apis/get-snapshot.asciidoc', - 'reference/ml/anomaly-detection/apis/post-data.asciidoc', - 'reference/ml/anomaly-detection/apis/revert-snapshot.asciidoc', - 'reference/ml/anomaly-detection/apis/update-snapshot.asciidoc', + 'reference/ml/anomaly-detection/transforms.asciidoc', + 'reference/ml/anomaly-detection/apis/delete-calendar-event.asciidoc', + 'reference/ml/anomaly-detection/apis/get-bucket.asciidoc', + 'reference/ml/anomaly-detection/apis/get-category.asciidoc', + 'reference/ml/anomaly-detection/apis/get-influencer.asciidoc', + 'reference/ml/anomaly-detection/apis/get-job-stats.asciidoc', + 'reference/ml/anomaly-detection/apis/get-overall-buckets.asciidoc', + 'reference/ml/anomaly-detection/apis/get-record.asciidoc', + 'reference/ml/anomaly-detection/apis/get-snapshot.asciidoc', + 'reference/ml/anomaly-detection/apis/post-data.asciidoc', + 'reference/ml/anomaly-detection/apis/revert-snapshot.asciidoc', + 'reference/ml/anomaly-detection/apis/update-snapshot.asciidoc', ] testClusters.integTest { @@ -116,20 +116,20 @@ Closure setupTwitter = { String name, int count -> index: twitter refresh: true body: |''' - for (int i = 0; i < count; i++) { - String user, text - if (i == 0) { - user = 'kimchy' - text = 'trying out Elasticsearch' - } else { - user = 'test' - text = "some message with the number $i" - } - buildRestTests.setups[name] += """ + for (int i = 0; i < count; i++) { + String user, text + if (i == 0) { + user = 'kimchy' + text = 'trying out Elasticsearch' + } else { + user = 'test' + text = "some message with the number $i" + } + buildRestTests.setups[name] += """ {"index":{"_id": "$i"}} {"user": "$user", "message": "$text", "date": "2009-11-15T14:12:12", "likes": $i}""" - } } +} setupTwitter('twitter', 5) setupTwitter('big_twitter', 120) setupTwitter('huge_twitter', 1200) @@ -501,7 +501,7 @@ buildRestTests.setups['latency'] = ''' for (int i = 0; i < 100; i++) { def value = i if (i % 10) { - value = i*10 + value = i * 10 } buildRestTests.setups['latency'] += """ {"index":{}} @@ -962,7 +962,7 @@ buildRestTests.setups['farequote_datafeed'] = buildRestTests.setups['farequote_j "job_id":"farequote", "indexes":"farequote" } -''' +''' buildRestTests.setups['server_metrics_index'] = ''' - do: indices.create: diff --git a/gradle/build-complete.gradle b/gradle/build-complete.gradle index fcb3d27bfde..86ad6d45043 100644 --- a/gradle/build-complete.gradle +++ b/gradle/build-complete.gradle @@ -3,36 +3,36 @@ import java.nio.file.Files String buildNumber = System.getenv('BUILD_NUMBER') if (buildNumber) { - File uploadFile = file("build/${buildNumber}.tar.bz2") - project.gradle.buildFinished { result -> - println "build complete, generating: $uploadFile" - if (uploadFile.exists()) { - project.delete(uploadFile) - } - - try { - ant.tar(destfile: uploadFile, compression: "bzip2", longfile: "gnu") { - fileset(dir: projectDir) { - fileTree(projectDir) - .include("**/*.hprof") - .include("**/reaper.log") - .include("**/build/testclusters/**") - .exclude("**/build/testclusters/**/data/**") - .exclude("**/build/testclusters/**/distro/**") - .exclude("**/build/testclusters/**/repo/**") - .exclude("**/build/testclusters/**/extract/**") - .filter { Files.isRegularFile(it.toPath()) } - .each { - include(name: projectDir.toPath().relativize(it.toPath())) - } - } - - fileset(dir: "${gradle.gradleUserHomeDir}/daemon/${gradle.gradleVersion}", followsymlinks: false) { - include(name: "**/daemon-${ProcessHandle.current().pid()}*.log") - } - } - } catch (Exception e) { - logger.lifecycle("Failed to archive additional logs", e) - } + File uploadFile = file("build/${buildNumber}.tar.bz2") + project.gradle.buildFinished { result -> + println "build complete, generating: $uploadFile" + if (uploadFile.exists()) { + project.delete(uploadFile) } + + try { + ant.tar(destfile: uploadFile, compression: "bzip2", longfile: "gnu") { + fileset(dir: projectDir) { + fileTree(projectDir) + .include("**/*.hprof") + .include("**/reaper.log") + .include("**/build/testclusters/**") + .exclude("**/build/testclusters/**/data/**") + .exclude("**/build/testclusters/**/distro/**") + .exclude("**/build/testclusters/**/repo/**") + .exclude("**/build/testclusters/**/extract/**") + .filter { Files.isRegularFile(it.toPath()) } + .each { + include(name: projectDir.toPath().relativize(it.toPath())) + } + } + + fileset(dir: "${gradle.gradleUserHomeDir}/daemon/${gradle.gradleVersion}", followsymlinks: false) { + include(name: "**/daemon-${ProcessHandle.current().pid()}*.log") + } + } + } catch (Exception e) { + logger.lifecycle("Failed to archive additional logs", e) + } + } } diff --git a/gradle/build-scan.gradle b/gradle/build-scan.gradle index 5c8920b47e4..9bfc26130b9 100644 --- a/gradle/build-scan.gradle +++ b/gradle/build-scan.gradle @@ -7,73 +7,73 @@ import java.util.concurrent.TimeUnit long startTime = project.gradle.services.get(BuildRequestMetaData.class).getStartTime() buildScan { - URL jenkinsUrl = System.getenv('JENKINS_URL') ? new URL(System.getenv('JENKINS_URL')) : null - String buildNumber = System.getenv('BUILD_NUMBER') - String buildUrl = System.getenv('BUILD_URL') - String jobName = System.getenv('JOB_NAME') - String nodeName = System.getenv('NODE_NAME') + URL jenkinsUrl = System.getenv('JENKINS_URL') ? new URL(System.getenv('JENKINS_URL')) : null + String buildNumber = System.getenv('BUILD_NUMBER') + String buildUrl = System.getenv('BUILD_URL') + String jobName = System.getenv('JOB_NAME') + String nodeName = System.getenv('NODE_NAME') - tag OS.current().name() - if (jobName) { - value 'Job name', jobName + tag OS.current().name() + if (jobName) { + value 'Job name', jobName + } + if (buildNumber) { + value 'Job number', buildNumber + } + + if (jenkinsUrl?.host?.endsWith('elastic.co')) { + publishAlways() + buildScan.server = 'https://gradle-enterprise.elastic.co' + } + + if (nodeName) { + link 'System logs', "https://infra-stats.elastic.co/app/infra#/logs?" + + "&logFilter=(expression:'host.name:${nodeName}',kind:kuery)" + buildFinished { + link 'System metrics', "https://infra-stats.elastic.co/app/infra#/metrics/host/" + + "${nodeName}?_g=()&metricTime=(autoReload:!f,refreshInterval:5000," + + "time:(from:${startTime - TimeUnit.MILLISECONDS.convert(5, TimeUnit.MINUTES)},interval:%3E%3D1m," + + "to:${System.currentTimeMillis() + TimeUnit.MILLISECONDS.convert(5, TimeUnit.MINUTES)}))" } - if(buildNumber) { - value 'Job number', buildNumber + } + + // Jenkins-specific build scan metadata + if (jenkinsUrl) { + tag 'CI' + tag jobName + link 'Jenkins Build', buildUrl + link 'GCP Upload', "https://console.cloud.google.com/storage/elasticsearch-ci-artifacts/jobs/${jobName}/build/${buildNumber}.tar.bz2" + + System.getenv().getOrDefault('NODE_LABELS', '').split(' ').each { + value 'Jenkins Worker Label', it } - if (jenkinsUrl?.host?.endsWith('elastic.co')) { - publishAlways() - buildScan.server = 'https://gradle-enterprise.elastic.co' - } - - if (nodeName) { - link 'System logs', "https://infra-stats.elastic.co/app/infra#/logs?" + - "&logFilter=(expression:'host.name:${nodeName}',kind:kuery)" - buildFinished { - link 'System metrics', "https://infra-stats.elastic.co/app/infra#/metrics/host/" + - "${nodeName}?_g=()&metricTime=(autoReload:!f,refreshInterval:5000," + - "time:(from:${startTime - TimeUnit.MILLISECONDS.convert(5, TimeUnit.MINUTES)},interval:%3E%3D1m," + - "to:${System.currentTimeMillis() + TimeUnit.MILLISECONDS.convert(5, TimeUnit.MINUTES)}))" - } - } - - // Jenkins-specific build scan metadata - if (jenkinsUrl) { - tag 'CI' - tag jobName - link 'Jenkins Build', buildUrl - link 'GCP Upload', "https://console.cloud.google.com/storage/elasticsearch-ci-artifacts/jobs/${jobName}/build/${buildNumber}.tar.bz2" - - System.getenv().getOrDefault('NODE_LABELS', '').split(' ').each { - value 'Jenkins Worker Label', it - } - - // Add SCM information - def isPrBuild = System.getenv('ROOT_BUILD_CAUSE_GHPRBCAUSE') != null - if (isPrBuild) { - value 'Git Commit ID', System.getenv('ghprbActualCommit') - value 'Git Branch', System.getenv('ghprbTargetBranch') - tag System.getenv('ghprbTargetBranch') - tag "pr/${System.getenv('ghprbPullId')}" - tag 'pull-request' - link 'Source', "https://github.com/elastic/elasticsearch/tree/${System.getenv('ghprbActualCommit')}" - link 'Pull Request', System.getenv('ghprbPullLink') - } else { - if (System.getenv('GIT_BRANCH')) { - def branch = System.getenv('GIT_BRANCH').split('/').last() - value 'Git Branch', branch - tag branch - } - if (System.getenv('GIT_COMMIT')) { - value 'Git Commit ID', System.getenv('GIT_COMMIT') - link 'Source', "https://github.com/elastic/elasticsearch/tree/${System.getenv('GIT_COMMIT')}" - background { - def changes = "git diff --name-only ${System.getenv('GIT_PREVIOUS_COMMIT')}..${System.getenv('GIT_COMMIT')}".execute().text.trim() - value 'Git Changes', changes - } - } - } + // Add SCM information + def isPrBuild = System.getenv('ROOT_BUILD_CAUSE_GHPRBCAUSE') != null + if (isPrBuild) { + value 'Git Commit ID', System.getenv('ghprbActualCommit') + value 'Git Branch', System.getenv('ghprbTargetBranch') + tag System.getenv('ghprbTargetBranch') + tag "pr/${System.getenv('ghprbPullId')}" + tag 'pull-request' + link 'Source', "https://github.com/elastic/elasticsearch/tree/${System.getenv('ghprbActualCommit')}" + link 'Pull Request', System.getenv('ghprbPullLink') } else { - tag 'LOCAL' + if (System.getenv('GIT_BRANCH')) { + def branch = System.getenv('GIT_BRANCH').split('/').last() + value 'Git Branch', branch + tag branch + } + if (System.getenv('GIT_COMMIT')) { + value 'Git Commit ID', System.getenv('GIT_COMMIT') + link 'Source', "https://github.com/elastic/elasticsearch/tree/${System.getenv('GIT_COMMIT')}" + background { + def changes = "git diff --name-only ${System.getenv('GIT_PREVIOUS_COMMIT')}..${System.getenv('GIT_COMMIT')}".execute().text.trim() + value 'Git Changes', changes + } + } } + } else { + tag 'LOCAL' + } } diff --git a/libs/build.gradle b/libs/build.gradle index 87d4838de73..80d34093a1b 100644 --- a/libs/build.gradle +++ b/libs/build.gradle @@ -18,29 +18,29 @@ */ subprojects { - /* - * All subprojects are java projects using Elasticsearch's standard build - * tools. - */ - apply plugin: 'elasticsearch.build' + /* + * All subprojects are java projects using Elasticsearch's standard build + * tools. + */ + apply plugin: 'elasticsearch.build' - /* - * Subprojects may depend on the "core" lib but may not depend on any - * other libs. This keeps our dependencies simpler. - */ - project.afterEvaluate { - configurations.all { Configuration conf -> - dependencies.matching { it instanceof ProjectDependency }.all { ProjectDependency dep -> - Project depProject = dep.dependencyProject - if (depProject != null - && false == depProject.path.equals(':libs:elasticsearch-core') - && depProject.path.startsWith(':libs')) { - throw new InvalidUserDataException("projects in :libs " - + "may not depend on other projects libs except " - + ":libs:elasticsearch-core but " - + "${project.path} depends on ${depProject.path}") - } - } + /* + * Subprojects may depend on the "core" lib but may not depend on any + * other libs. This keeps our dependencies simpler. + */ + project.afterEvaluate { + configurations.all { Configuration conf -> + dependencies.matching { it instanceof ProjectDependency }.all { ProjectDependency dep -> + Project depProject = dep.dependencyProject + if (depProject != null + && false == depProject.path.equals(':libs:elasticsearch-core') + && depProject.path.startsWith(':libs')) { + throw new InvalidUserDataException("projects in :libs " + + "may not depend on other projects libs except " + + ":libs:elasticsearch-core but " + + "${project.path} depends on ${depProject.path}") } + } } + } } diff --git a/libs/cli/build.gradle b/libs/cli/build.gradle index a97c62096a5..50374dcccae 100644 --- a/libs/cli/build.gradle +++ b/libs/cli/build.gradle @@ -22,8 +22,8 @@ apply plugin: 'nebula.maven-base-publish' apply plugin: 'nebula.maven-scm' dependencies { - compile 'net.sf.jopt-simple:jopt-simple:5.0.2' - compile project(':libs:elasticsearch-core') + compile 'net.sf.jopt-simple:jopt-simple:5.0.2' + compile project(':libs:elasticsearch-core') } test.enabled = false @@ -31,5 +31,5 @@ test.enabled = false jarHell.enabled = false forbiddenApisMain { - replaceSignatureFiles 'jdk-signatures' + replaceSignatureFiles 'jdk-signatures' } diff --git a/libs/core/build.gradle b/libs/core/build.gradle index 79129b4db8c..cb3b7360883 100644 --- a/libs/core/build.gradle +++ b/libs/core/build.gradle @@ -27,85 +27,85 @@ archivesBaseName = 'elasticsearch-core' // we want to keep the JDKs in our IDEs set to JDK 8 until minimum JDK is bumped to 9 so we do not include this source set in our IDEs if (!isEclipse && !isIdea) { - sourceSets { - java9 { - java { - srcDirs = ['src/main/java9'] - } - } + sourceSets { + java9 { + java { + srcDirs = ['src/main/java9'] + } } + } - configurations { - java9Compile.extendsFrom(compile) - } + configurations { + java9Compile.extendsFrom(compile) + } - dependencies { - java9Compile sourceSets.main.output - } + dependencies { + java9Compile sourceSets.main.output + } - compileJava9Java { - sourceCompatibility = 9 - targetCompatibility = 9 - } + compileJava9Java { + sourceCompatibility = 9 + targetCompatibility = 9 + } - forbiddenApisJava9 { - rootProject.globalInfo.ready { - if (BuildParams.runtimeJavaVersion < JavaVersion.VERSION_1_9) { - targetCompatibility = JavaVersion.VERSION_1_9.getMajorVersion() - } - replaceSignatureFiles 'jdk-signatures' - } + forbiddenApisJava9 { + rootProject.globalInfo.ready { + if (BuildParams.runtimeJavaVersion < JavaVersion.VERSION_1_9) { + targetCompatibility = JavaVersion.VERSION_1_9.getMajorVersion() + } + replaceSignatureFiles 'jdk-signatures' } + } - jar { - metaInf { - into 'versions/9' - from sourceSets.java9.output - } - manifest.attributes('Multi-Release': 'true') + jar { + metaInf { + into 'versions/9' + from sourceSets.java9.output } + manifest.attributes('Multi-Release': 'true') + } } publishing { - publications { - nebula { - artifactId = archivesBaseName - } + publications { + nebula { + artifactId = archivesBaseName } + } } dependencies { - // This dependency is used only by :libs:core for null-checking interop with other tools - compileOnly "com.google.code.findbugs:jsr305:3.0.2" + // This dependency is used only by :libs:core for null-checking interop with other tools + compileOnly "com.google.code.findbugs:jsr305:3.0.2" - testCompile "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${versions.randomizedrunner}" - testCompile "junit:junit:${versions.junit}" - testCompile "org.hamcrest:hamcrest:${versions.hamcrest}" + testCompile "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${versions.randomizedrunner}" + testCompile "junit:junit:${versions.junit}" + testCompile "org.hamcrest:hamcrest:${versions.hamcrest}" - if (!isEclipse && !isIdea) { - java9Compile sourceSets.main.output - } + if (!isEclipse && !isIdea) { + java9Compile sourceSets.main.output + } - testCompile(project(":test:framework")) { - exclude group: 'org.elasticsearch', module: 'elasticsearch-core' - } + testCompile(project(":test:framework")) { + exclude group: 'org.elasticsearch', module: 'elasticsearch-core' + } } forbiddenApisMain { - // :libs:elasticsearch-core does not depend on server - // TODO: Need to decide how we want to handle for forbidden signatures with the changes to server - replaceSignatureFiles 'jdk-signatures' + // :libs:elasticsearch-core does not depend on server + // TODO: Need to decide how we want to handle for forbidden signatures with the changes to server + replaceSignatureFiles 'jdk-signatures' } -thirdPartyAudit.ignoreMissingClasses ( - // from log4j - 'org/osgi/framework/AdaptPermission', - 'org/osgi/framework/AdminPermission', - 'org/osgi/framework/Bundle', - 'org/osgi/framework/BundleActivator', - 'org/osgi/framework/BundleContext', - 'org/osgi/framework/BundleEvent', - 'org/osgi/framework/SynchronousBundleListener', - 'org/osgi/framework/wiring/BundleWire', - 'org/osgi/framework/wiring/BundleWiring' +thirdPartyAudit.ignoreMissingClasses( + // from log4j + 'org/osgi/framework/AdaptPermission', + 'org/osgi/framework/AdminPermission', + 'org/osgi/framework/Bundle', + 'org/osgi/framework/BundleActivator', + 'org/osgi/framework/BundleContext', + 'org/osgi/framework/BundleEvent', + 'org/osgi/framework/SynchronousBundleListener', + 'org/osgi/framework/wiring/BundleWire', + 'org/osgi/framework/wiring/BundleWiring' ) diff --git a/libs/dissect/build.gradle b/libs/dissect/build.gradle index 7c89985c24b..f0791ea5a69 100644 --- a/libs/dissect/build.gradle +++ b/libs/dissect/build.gradle @@ -18,15 +18,15 @@ */ dependencies { - testCompile(project(":test:framework")) { - exclude group: 'org.elasticsearch', module: 'elasticsearch-dissect' - } - testCompile "com.fasterxml.jackson.core:jackson-core:${versions.jackson}" - testCompile "com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}" - testCompile "com.fasterxml.jackson.core:jackson-databind:${versions.jackson}" + testCompile(project(":test:framework")) { + exclude group: 'org.elasticsearch', module: 'elasticsearch-dissect' + } + testCompile "com.fasterxml.jackson.core:jackson-core:${versions.jackson}" + testCompile "com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}" + testCompile "com.fasterxml.jackson.core:jackson-databind:${versions.jackson}" } forbiddenApisMain { - replaceSignatureFiles 'jdk-signatures' + replaceSignatureFiles 'jdk-signatures' } diff --git a/libs/geo/build.gradle b/libs/geo/build.gradle index 1863a63a9e8..c48f7eaebbd 100644 --- a/libs/geo/build.gradle +++ b/libs/geo/build.gradle @@ -22,14 +22,14 @@ apply plugin: 'nebula.maven-base-publish' apply plugin: 'nebula.maven-scm' dependencies { - testCompile(project(":test:framework")) { - exclude group: 'org.elasticsearch', module: 'elasticsearch-geo' - } + testCompile(project(":test:framework")) { + exclude group: 'org.elasticsearch', module: 'elasticsearch-geo' + } } forbiddenApisMain { - // geo does not depend on server - // TODO: Need to decide how we want to handle for forbidden signatures with the changes to core - replaceSignatureFiles 'jdk-signatures' + // geo does not depend on server + // TODO: Need to decide how we want to handle for forbidden signatures with the changes to core + replaceSignatureFiles 'jdk-signatures' } diff --git a/libs/grok/build.gradle b/libs/grok/build.gradle index 04b5a62715c..ba5811077ff 100644 --- a/libs/grok/build.gradle +++ b/libs/grok/build.gradle @@ -18,15 +18,15 @@ */ dependencies { - compile 'org.jruby.joni:joni:2.1.29' - // joni dependencies: - compile 'org.jruby.jcodings:jcodings:1.0.44' + compile 'org.jruby.joni:joni:2.1.29' + // joni dependencies: + compile 'org.jruby.jcodings:jcodings:1.0.44' - testCompile(project(":test:framework")) { - exclude group: 'org.elasticsearch', module: 'elasticsearch-grok' - } + testCompile(project(":test:framework")) { + exclude group: 'org.elasticsearch', module: 'elasticsearch-grok' + } } forbiddenApisMain { - replaceSignatureFiles 'jdk-signatures' + replaceSignatureFiles 'jdk-signatures' } diff --git a/libs/nio/build.gradle b/libs/nio/build.gradle index db09a6e7c2f..b8afdd8f103 100644 --- a/libs/nio/build.gradle +++ b/libs/nio/build.gradle @@ -27,7 +27,7 @@ dependencies { testCompile "org.hamcrest:hamcrest:${versions.hamcrest}" testCompile(project(":test:framework")) { - exclude group: 'org.elasticsearch', module: 'elasticsearch-nio' + exclude group: 'org.elasticsearch', module: 'elasticsearch-nio' } } diff --git a/libs/secure-sm/build.gradle b/libs/secure-sm/build.gradle index 068a140da37..152fd387b1e 100644 --- a/libs/secure-sm/build.gradle +++ b/libs/secure-sm/build.gradle @@ -20,29 +20,29 @@ apply plugin: 'nebula.maven-base-publish' apply plugin: 'nebula.maven-scm' dependencies { - // do not add non-test compile dependencies to secure-sm without a good reason to do so + // do not add non-test compile dependencies to secure-sm without a good reason to do so - testCompile "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${versions.randomizedrunner}" - testCompile "junit:junit:${versions.junit}" - testCompile "org.hamcrest:hamcrest:${versions.hamcrest}" - - testCompile(project(":test:framework")) { - exclude group: 'org.elasticsearch', module: 'elasticsearch-secure-sm' - } + testCompile "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${versions.randomizedrunner}" + testCompile "junit:junit:${versions.junit}" + testCompile "org.hamcrest:hamcrest:${versions.hamcrest}" + + testCompile(project(":test:framework")) { + exclude group: 'org.elasticsearch', module: 'elasticsearch-secure-sm' + } } forbiddenApisMain { - replaceSignatureFiles 'jdk-signatures' + replaceSignatureFiles 'jdk-signatures' } // JAR hell is part of core which we do not want to add as a dependency jarHell.enabled = false testingConventions { - naming.clear() - naming { - Tests { - baseClass 'junit.framework.TestCase' - } + naming.clear() + naming { + Tests { + baseClass 'junit.framework.TestCase' } + } } diff --git a/libs/ssl-config/build.gradle b/libs/ssl-config/build.gradle index bae6b00f5ad..24b7ebc79a7 100644 --- a/libs/ssl-config/build.gradle +++ b/libs/ssl-config/build.gradle @@ -19,25 +19,25 @@ apply plugin: "nebula.maven-scm" dependencies { - compile project(':libs:elasticsearch-core') + compile project(':libs:elasticsearch-core') - testCompile(project(":test:framework")) { - exclude group: 'org.elasticsearch', module: 'elasticsearch-ssl-config' - } + testCompile(project(":test:framework")) { + exclude group: 'org.elasticsearch', module: 'elasticsearch-ssl-config' + } - testCompile "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${versions.randomizedrunner}" - testCompile "junit:junit:${versions.junit}" - testCompile "org.hamcrest:hamcrest:${versions.hamcrest}" + testCompile "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${versions.randomizedrunner}" + testCompile "junit:junit:${versions.junit}" + testCompile "org.hamcrest:hamcrest:${versions.hamcrest}" } forbiddenApisMain { - replaceSignatureFiles 'jdk-signatures' + replaceSignatureFiles 'jdk-signatures' } forbiddenPatterns { - exclude '**/*.key' - exclude '**/*.pem' - exclude '**/*.p12' - exclude '**/*.jks' + exclude '**/*.key' + exclude '**/*.pem' + exclude '**/*.p12' + exclude '**/*.jks' } diff --git a/libs/x-content/build.gradle b/libs/x-content/build.gradle index ee8e520cdb1..14adf7d102d 100644 --- a/libs/x-content/build.gradle +++ b/libs/x-content/build.gradle @@ -22,33 +22,33 @@ apply plugin: 'nebula.maven-base-publish' apply plugin: 'nebula.maven-scm' dependencies { - compile project(':libs:elasticsearch-core') + compile project(':libs:elasticsearch-core') - compile "org.yaml:snakeyaml:${versions.snakeyaml}" - compile "com.fasterxml.jackson.core:jackson-core:${versions.jackson}" - compile "com.fasterxml.jackson.dataformat:jackson-dataformat-smile:${versions.jackson}" - compile "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:${versions.jackson}" - compile "com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:${versions.jackson}" + compile "org.yaml:snakeyaml:${versions.snakeyaml}" + compile "com.fasterxml.jackson.core:jackson-core:${versions.jackson}" + compile "com.fasterxml.jackson.dataformat:jackson-dataformat-smile:${versions.jackson}" + compile "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:${versions.jackson}" + compile "com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:${versions.jackson}" - testCompile "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${versions.randomizedrunner}" - testCompile "junit:junit:${versions.junit}" - testCompile "org.hamcrest:hamcrest:${versions.hamcrest}" + testCompile "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${versions.randomizedrunner}" + testCompile "junit:junit:${versions.junit}" + testCompile "org.hamcrest:hamcrest:${versions.hamcrest}" - testCompile(project(":test:framework")) { - exclude group: 'org.elasticsearch', module: 'elasticsearch-x-content' - } + testCompile(project(":test:framework")) { + exclude group: 'org.elasticsearch', module: 'elasticsearch-x-content' + } } forbiddenApisMain { - // x-content does not depend on server - // TODO: Need to decide how we want to handle for forbidden signatures with the changes to core - replaceSignatureFiles 'jdk-signatures' + // x-content does not depend on server + // TODO: Need to decide how we want to handle for forbidden signatures with the changes to core + replaceSignatureFiles 'jdk-signatures' } -thirdPartyAudit.ignoreMissingClasses ( - // from com.fasterxml.jackson.dataformat.yaml.YAMLMapper (jackson-dataformat-yaml) - 'com.fasterxml.jackson.databind.ObjectMapper', +thirdPartyAudit.ignoreMissingClasses( + // from com.fasterxml.jackson.dataformat.yaml.YAMLMapper (jackson-dataformat-yaml) + 'com.fasterxml.jackson.databind.ObjectMapper', ) dependencyLicenses { diff --git a/modules/aggs-matrix-stats/build.gradle b/modules/aggs-matrix-stats/build.gradle index d3af124b8af..89b0fc89780 100644 --- a/modules/aggs-matrix-stats/build.gradle +++ b/modules/aggs-matrix-stats/build.gradle @@ -18,7 +18,7 @@ */ esplugin { - description 'Adds aggregations whose input are a list of numeric fields and output includes a matrix.' - classname 'org.elasticsearch.search.aggregations.matrix.MatrixAggregationPlugin' - hasClientJar = true + description 'Adds aggregations whose input are a list of numeric fields and output includes a matrix.' + classname 'org.elasticsearch.search.aggregations.matrix.MatrixAggregationPlugin' + hasClientJar = true } diff --git a/modules/analysis-common/build.gradle b/modules/analysis-common/build.gradle index 2bb9a009abc..773c645f698 100644 --- a/modules/analysis-common/build.gradle +++ b/modules/analysis-common/build.gradle @@ -18,11 +18,11 @@ */ esplugin { - description 'Adds "built in" analyzers to Elasticsearch.' - classname 'org.elasticsearch.analysis.common.CommonAnalysisPlugin' - extendedPlugins = ['lang-painless'] + description 'Adds "built in" analyzers to Elasticsearch.' + classname 'org.elasticsearch.analysis.common.CommonAnalysisPlugin' + extendedPlugins = ['lang-painless'] } dependencies { - compileOnly project(':modules:lang-painless') + compileOnly project(':modules:lang-painless') } diff --git a/modules/build.gradle b/modules/build.gradle index e1ecc1f6cc2..eea32dc6937 100644 --- a/modules/build.gradle +++ b/modules/build.gradle @@ -19,7 +19,7 @@ configure(subprojects.findAll { it.parent.path == project.path }) { group = 'org.elasticsearch.plugin' // for modules which publish client jars - apply plugin: 'elasticsearch.testclusters' + apply plugin: 'elasticsearch.testclusters' apply plugin: 'elasticsearch.esplugin' esplugin { @@ -28,12 +28,12 @@ configure(subprojects.findAll { it.parent.path == project.path }) { } if (project.file('src/main/packaging').exists()) { - throw new InvalidModelException("Modules cannot contain packaging files") + throw new InvalidModelException("Modules cannot contain packaging files") } if (project.file('src/main/bin').exists()) { - throw new InvalidModelException("Modules cannot contain bin files") + throw new InvalidModelException("Modules cannot contain bin files") } if (project.file('src/main/config').exists()) { - throw new InvalidModelException("Modules cannot contain config files") + throw new InvalidModelException("Modules cannot contain config files") } } diff --git a/modules/ingest-common/build.gradle b/modules/ingest-common/build.gradle index 00c444e50e8..ec8f8b7c371 100644 --- a/modules/ingest-common/build.gradle +++ b/modules/ingest-common/build.gradle @@ -18,13 +18,13 @@ */ esplugin { - description 'Module for ingest processors that do not require additional security permissions or have large dependencies and resources' - classname 'org.elasticsearch.ingest.common.IngestCommonPlugin' - extendedPlugins = ['lang-painless'] + description 'Module for ingest processors that do not require additional security permissions or have large dependencies and resources' + classname 'org.elasticsearch.ingest.common.IngestCommonPlugin' + extendedPlugins = ['lang-painless'] } dependencies { - compileOnly project(':modules:lang-painless') - compile project(':libs:elasticsearch-grok') - compile project(':libs:elasticsearch-dissect') -} \ No newline at end of file + compileOnly project(':modules:lang-painless') + compile project(':libs:elasticsearch-grok') + compile project(':libs:elasticsearch-dissect') +} diff --git a/modules/ingest-geoip/build.gradle b/modules/ingest-geoip/build.gradle index 52317608e74..72d0fc973b7 100644 --- a/modules/ingest-geoip/build.gradle +++ b/modules/ingest-geoip/build.gradle @@ -26,7 +26,7 @@ esplugin { dependencies { // Upgrade to 2.10.0 or higher when jackson-core gets upgraded to 2.9.x. Blocked by #27032 - compile ('com.maxmind.geoip2:geoip2:2.9.0') + compile('com.maxmind.geoip2:geoip2:2.9.0') // geoip2 dependencies: compile("com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}") compile("com.fasterxml.jackson.core:jackson-databind:2.8.11.3") @@ -36,7 +36,7 @@ dependencies { } task copyDefaultGeoIp2DatabaseFiles(type: Copy) { - from { zipTree(configurations.testCompile.files.find { it.name.contains('geolite2-databases')}) } + from { zipTree(configurations.testCompile.files.find { it.name.contains('geolite2-databases') }) } into "${project.buildDir}/ingest-geoip" include "*.mmdb" } @@ -49,7 +49,7 @@ bundlePlugin { } } -thirdPartyAudit.ignoreMissingClasses ( +thirdPartyAudit.ignoreMissingClasses( // geoip WebServiceClient needs apache http client, but we're not using WebServiceClient: 'org.apache.http.HttpEntity', 'org.apache.http.HttpHost', diff --git a/modules/lang-painless/build.gradle b/modules/lang-painless/build.gradle index c9eadd7a3f7..b7103c71453 100644 --- a/modules/lang-painless/build.gradle +++ b/modules/lang-painless/build.gradle @@ -17,6 +17,7 @@ * under the License. */ import org.elasticsearch.gradle.testclusters.DefaultTestClustersTask; + esplugin { description 'An easy, safe and fast scripting language for Elasticsearch' classname 'org.elasticsearch.painless.PainlessPlugin' @@ -75,12 +76,12 @@ dependencies { testClusters { generateContextCluster { - testDistribution = 'DEFAULT' + testDistribution = 'DEFAULT' } } task generateContextDoc(type: DefaultTestClustersTask) { - useCluster testClusters.generateContextCluster + useCluster testClusters.generateContextCluster doFirst { project.javaexec { main = 'org.elasticsearch.painless.ContextDocGenerator' @@ -123,9 +124,9 @@ task regenLexer(type: JavaExec) { systemProperty 'user.country', 'US' systemProperty 'user.variant', '' args '-Werror', - '-package', 'org.elasticsearch.painless.antlr', - '-o', outputPath, - "${file(grammarPath)}/PainlessLexer.g4" + '-package', 'org.elasticsearch.painless.antlr', + '-o', outputPath, + "${file(grammarPath)}/PainlessLexer.g4" } task regenParser(type: JavaExec) { @@ -137,12 +138,12 @@ task regenParser(type: JavaExec) { systemProperty 'user.country', 'US' systemProperty 'user.variant', '' args '-Werror', - '-package', 'org.elasticsearch.painless.antlr', - '-no-listener', - '-visitor', - // '-Xlog', - '-o', outputPath, - "${file(grammarPath)}/PainlessParser.g4" + '-package', 'org.elasticsearch.painless.antlr', + '-no-listener', + '-visitor', + // '-Xlog', + '-o', outputPath, + "${file(grammarPath)}/PainlessParser.g4" } task regen { @@ -153,20 +154,20 @@ task regen { ant.move(file: "${outputPath}/PainlessParser.tokens", toDir: grammarPath) // make the generated classes package private ant.replaceregexp(match: 'public ((interface|class) \\QPainless\\E\\w+)', - replace: '\\1', - encoding: 'UTF-8') { + replace: '\\1', + encoding: 'UTF-8') { fileset(dir: outputPath, includes: 'Painless*.java') } // make the lexer abstract ant.replaceregexp(match: '(class \\QPainless\\ELexer)', - replace: 'abstract \\1', - encoding: 'UTF-8') { + replace: 'abstract \\1', + encoding: 'UTF-8') { fileset(dir: outputPath, includes: 'PainlessLexer.java') } // nuke timestamps/filenames in generated files ant.replaceregexp(match: '\\Q// Generated from \\E.*', - replace: '\\/\\/ ANTLR GENERATED CODE: DO NOT EDIT', - encoding: 'UTF-8') { + replace: '\\/\\/ ANTLR GENERATED CODE: DO NOT EDIT', + encoding: 'UTF-8') { fileset(dir: outputPath, includes: 'Painless*.java') } // remove tabs in antlr generated files diff --git a/modules/mapper-extras/build.gradle b/modules/mapper-extras/build.gradle index c0b6527114d..983aa475fd1 100644 --- a/modules/mapper-extras/build.gradle +++ b/modules/mapper-extras/build.gradle @@ -18,7 +18,7 @@ */ esplugin { - description 'Adds advanced field mappers' - classname 'org.elasticsearch.index.mapper.MapperExtrasPlugin' - hasClientJar = true -} \ No newline at end of file + description 'Adds advanced field mappers' + classname 'org.elasticsearch.index.mapper.MapperExtrasPlugin' + hasClientJar = true +} diff --git a/modules/percolator/build.gradle b/modules/percolator/build.gradle index 0826c91676d..05fbd652e55 100644 --- a/modules/percolator/build.gradle +++ b/modules/percolator/build.gradle @@ -18,13 +18,13 @@ */ esplugin { - description 'Percolator module adds capability to index queries and query these queries by specifying documents' - classname 'org.elasticsearch.percolator.PercolatorPlugin' - hasClientJar = true + description 'Percolator module adds capability to index queries and query these queries by specifying documents' + classname 'org.elasticsearch.percolator.PercolatorPlugin' + hasClientJar = true } dependencies { - testCompile project(path: ':modules:parent-join', configuration: 'runtime') + testCompile project(path: ':modules:parent-join', configuration: 'runtime') } dependencyLicenses { diff --git a/modules/reindex/build.gradle b/modules/reindex/build.gradle index 0c6130b5737..8ff83698e8d 100644 --- a/modules/reindex/build.gradle +++ b/modules/reindex/build.gradle @@ -56,7 +56,7 @@ dependencies { testCompile project(path: ':modules:parent-join', configuration: 'runtime') } -thirdPartyAudit.ignoreMissingClasses ( +thirdPartyAudit.ignoreMissingClasses( // Commons logging 'javax.servlet.ServletContextEvent', 'javax.servlet.ServletContextListener', @@ -66,8 +66,8 @@ thirdPartyAudit.ignoreMissingClasses ( ) forbiddenPatterns { - // PKCS#12 file are not UTF-8 - exclude '**/*.p12' + // PKCS#12 file are not UTF-8 + exclude '**/*.p12' } // Support for testing reindex-from-remote against old Elasticsearch versions @@ -117,12 +117,12 @@ if (Os.isFamily(Os.FAMILY_WINDOWS)) { dependsOn project.configurations.oldesFixture dependsOn unzip executable = "${BuildParams.runtimeJavaHome}/bin/java" - env 'CLASSPATH', "${ -> project.configurations.oldesFixture.asPath }" - env 'JAVA_HOME', "${ -> getJavaHome(it, 8)}" + env 'CLASSPATH', "${-> project.configurations.oldesFixture.asPath}" + env 'JAVA_HOME', "${-> getJavaHome(it, 8)}" args 'oldes.OldElasticsearch', - baseDir, - unzip.temporaryDir, - version == '090' + baseDir, + unzip.temporaryDir, + version == '090' waitCondition = { fixture, ant -> // the fixture writes the ports file when Elasticsearch's HTTP service // is ready, so we can just wait for the file to exist @@ -136,8 +136,8 @@ if (Os.isFamily(Os.FAMILY_WINDOWS)) { systemProperty "tests.fromOld", "true" /* Use a closure on the string to delay evaluation until right before we * run the integration tests so that we can be sure that the file is - * ready. */ - nonInputProperties.systemProperty "es${version}.port", "${ -> fixture.addressAndPort }" + * ready. */ + nonInputProperties.systemProperty "es${version}.port", "${-> fixture.addressAndPort}" } } } diff --git a/modules/repository-url/build.gradle b/modules/repository-url/build.gradle index b17c223dd6a..31fba2964f0 100644 --- a/modules/repository-url/build.gradle +++ b/modules/repository-url/build.gradle @@ -22,8 +22,8 @@ import org.elasticsearch.gradle.info.BuildParams import org.elasticsearch.gradle.test.AntFixture esplugin { - description 'Module for URL repository' - classname 'org.elasticsearch.plugin.repository.url.URLRepositoryPlugin' + description 'Module for URL repository' + classname 'org.elasticsearch.plugin.repository.url.URLRepositoryPlugin' } // This directory is shared between two URL repositories and one FS repository in YAML integration tests @@ -31,21 +31,23 @@ File repositoryDir = new File(project.buildDir, "shared-repository") /** A task to start the URLFixture which exposes the repositoryDir over HTTP **/ task urlFixture(type: AntFixture) { - dependsOn testClasses - doFirst { - repositoryDir.mkdirs() - } - env 'CLASSPATH', "${ -> project.sourceSets.test.runtimeClasspath.asPath }" - executable = "${BuildParams.runtimeJavaHome}/bin/java" - args 'org.elasticsearch.repositories.url.URLFixture', baseDir, "${repositoryDir.absolutePath}" + dependsOn testClasses + doFirst { + repositoryDir.mkdirs() + } + env 'CLASSPATH', "${-> project.sourceSets.test.runtimeClasspath.asPath}" + executable = "${BuildParams.runtimeJavaHome}/bin/java" + args 'org.elasticsearch.repositories.url.URLFixture', baseDir, "${repositoryDir.absolutePath}" } integTest { - dependsOn urlFixture + dependsOn urlFixture } testClusters.integTest { - // repositoryDir is used by a FS repository to create snapshots - setting 'path.repo', "${repositoryDir.absolutePath}", PropertyNormalization.IGNORE_VALUE - // repositoryDir is used by two URL repositories to restore snapshots - setting 'repositories.url.allowed_urls', { "http://snapshot.test*,http://${urlFixture.addressAndPort}" }, PropertyNormalization.IGNORE_VALUE + // repositoryDir is used by a FS repository to create snapshots + setting 'path.repo', "${repositoryDir.absolutePath}", PropertyNormalization.IGNORE_VALUE + // repositoryDir is used by two URL repositories to restore snapshots + setting 'repositories.url.allowed_urls', { + "http://snapshot.test*,http://${urlFixture.addressAndPort}" + }, PropertyNormalization.IGNORE_VALUE } diff --git a/modules/systemd/build.gradle b/modules/systemd/build.gradle index 517feeef47b..2863846801c 100644 --- a/modules/systemd/build.gradle +++ b/modules/systemd/build.gradle @@ -18,8 +18,8 @@ */ esplugin { - description 'Integrates Elasticsearch with systemd' - classname 'org.elasticsearch.systemd.SystemdPlugin' + description 'Integrates Elasticsearch with systemd' + classname 'org.elasticsearch.systemd.SystemdPlugin' } integTest.enabled = false diff --git a/modules/transport-netty4/build.gradle b/modules/transport-netty4/build.gradle index 4308487ba71..94600cddd3c 100644 --- a/modules/transport-netty4/build.gradle +++ b/modules/transport-netty4/build.gradle @@ -28,22 +28,22 @@ import org.elasticsearch.gradle.test.RestIntegTestTask * maybe figure out a way to run all tests from core with netty4/network? */ esplugin { - description 'Netty 4 based transport implementation' - classname 'org.elasticsearch.transport.Netty4Plugin' - hasClientJar = true + description 'Netty 4 based transport implementation' + classname 'org.elasticsearch.transport.Netty4Plugin' + hasClientJar = true } compileTestJava.options.compilerArgs << "-Xlint:-cast,-rawtypes,-unchecked" dependencies { - // network stack - compile "io.netty:netty-buffer:${versions.netty}" - compile "io.netty:netty-codec:${versions.netty}" - compile "io.netty:netty-codec-http:${versions.netty}" - compile "io.netty:netty-common:${versions.netty}" - compile "io.netty:netty-handler:${versions.netty}" - compile "io.netty:netty-resolver:${versions.netty}" - compile "io.netty:netty-transport:${versions.netty}" + // network stack + compile "io.netty:netty-buffer:${versions.netty}" + compile "io.netty:netty-codec:${versions.netty}" + compile "io.netty:netty-codec-http:${versions.netty}" + compile "io.netty:netty-common:${versions.netty}" + compile "io.netty:netty-handler:${versions.netty}" + compile "io.netty:netty-resolver:${versions.netty}" + compile "io.netty:netty-transport:${versions.netty}" } dependencyLicenses { @@ -51,19 +51,19 @@ dependencyLicenses { } test { - /* - * We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each - * other if we allow them to set the number of available processors as it's set-once in Netty. - */ - systemProperty 'es.set.netty.runtime.available.processors', 'false' + /* + * We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each + * other if we allow them to set the number of available processors as it's set-once in Netty. + */ + systemProperty 'es.set.netty.runtime.available.processors', 'false' } integTestRunner { - /* - * We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each - * other if we allow them to set the number of available processors as it's set-once in Netty. - */ - systemProperty 'es.set.netty.runtime.available.processors', 'false' + /* + * We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each + * other if we allow them to set the number of available processors as it's set-once in Netty. + */ + systemProperty 'es.set.netty.runtime.available.processors', 'false' } TaskProvider pooledTest = tasks.register("pooledTest", Test) { @@ -83,126 +83,126 @@ testClusters.pooledIntegTest { check.dependsOn(pooledTest, pooledIntegTest) thirdPartyAudit { - ignoreMissingClasses ( - // classes are missing + ignoreMissingClasses( + // classes are missing - // from io.netty.handler.codec.protobuf.ProtobufDecoder (netty) - 'com.google.protobuf.ExtensionRegistry', - 'com.google.protobuf.MessageLite$Builder', - 'com.google.protobuf.MessageLite', - 'com.google.protobuf.Parser', + // from io.netty.handler.codec.protobuf.ProtobufDecoder (netty) + 'com.google.protobuf.ExtensionRegistry', + 'com.google.protobuf.MessageLite$Builder', + 'com.google.protobuf.MessageLite', + 'com.google.protobuf.Parser', - // from io.netty.logging.CommonsLoggerFactory (netty) - 'org.apache.commons.logging.Log', - 'org.apache.commons.logging.LogFactory', + // from io.netty.logging.CommonsLoggerFactory (netty) + 'org.apache.commons.logging.Log', + 'org.apache.commons.logging.LogFactory', - // from Log4j (deliberate, Netty will fallback to Log4j 2) - 'org.apache.log4j.Level', - 'org.apache.log4j.Logger', + // from Log4j (deliberate, Netty will fallback to Log4j 2) + 'org.apache.log4j.Level', + 'org.apache.log4j.Logger', - // from io.netty.handler.ssl.OpenSslEngine (netty) - 'io.netty.internal.tcnative.Buffer', - 'io.netty.internal.tcnative.Library', - 'io.netty.internal.tcnative.SSL', - 'io.netty.internal.tcnative.SSLContext', - 'io.netty.internal.tcnative.SSLPrivateKeyMethod', + // from io.netty.handler.ssl.OpenSslEngine (netty) + 'io.netty.internal.tcnative.Buffer', + 'io.netty.internal.tcnative.Library', + 'io.netty.internal.tcnative.SSL', + 'io.netty.internal.tcnative.SSLContext', + 'io.netty.internal.tcnative.SSLPrivateKeyMethod', - // from io.netty.handler.ssl.util.BouncyCastleSelfSignedCertGenerator (netty) - 'org.bouncycastle.cert.X509v3CertificateBuilder', - 'org.bouncycastle.cert.jcajce.JcaX509CertificateConverter', - 'org.bouncycastle.cert.jcajce.JcaX509v3CertificateBuilder', - 'org.bouncycastle.jce.provider.BouncyCastleProvider', - 'org.bouncycastle.operator.jcajce.JcaContentSignerBuilder', + // from io.netty.handler.ssl.util.BouncyCastleSelfSignedCertGenerator (netty) + 'org.bouncycastle.cert.X509v3CertificateBuilder', + 'org.bouncycastle.cert.jcajce.JcaX509CertificateConverter', + 'org.bouncycastle.cert.jcajce.JcaX509v3CertificateBuilder', + 'org.bouncycastle.jce.provider.BouncyCastleProvider', + 'org.bouncycastle.operator.jcajce.JcaContentSignerBuilder', - // from io.netty.handler.ssl.JettyNpnSslEngine (netty) - 'org.eclipse.jetty.npn.NextProtoNego$ClientProvider', - 'org.eclipse.jetty.npn.NextProtoNego$ServerProvider', - 'org.eclipse.jetty.npn.NextProtoNego', + // from io.netty.handler.ssl.JettyNpnSslEngine (netty) + 'org.eclipse.jetty.npn.NextProtoNego$ClientProvider', + 'org.eclipse.jetty.npn.NextProtoNego$ServerProvider', + 'org.eclipse.jetty.npn.NextProtoNego', - // from io.netty.handler.codec.marshalling.ChannelBufferByteInput (netty) - 'org.jboss.marshalling.ByteInput', + // from io.netty.handler.codec.marshalling.ChannelBufferByteInput (netty) + 'org.jboss.marshalling.ByteInput', - // from io.netty.handler.codec.marshalling.ChannelBufferByteOutput (netty) - 'org.jboss.marshalling.ByteOutput', + // from io.netty.handler.codec.marshalling.ChannelBufferByteOutput (netty) + 'org.jboss.marshalling.ByteOutput', - // from io.netty.handler.codec.marshalling.CompatibleMarshallingEncoder (netty) - 'org.jboss.marshalling.Marshaller', + // from io.netty.handler.codec.marshalling.CompatibleMarshallingEncoder (netty) + 'org.jboss.marshalling.Marshaller', - // from io.netty.handler.codec.marshalling.ContextBoundUnmarshallerProvider (netty) - 'org.jboss.marshalling.MarshallerFactory', - 'org.jboss.marshalling.MarshallingConfiguration', - 'org.jboss.marshalling.Unmarshaller', + // from io.netty.handler.codec.marshalling.ContextBoundUnmarshallerProvider (netty) + 'org.jboss.marshalling.MarshallerFactory', + 'org.jboss.marshalling.MarshallingConfiguration', + 'org.jboss.marshalling.Unmarshaller', - // from io.netty.util.internal.logging.InternalLoggerFactory (netty) - it's optional - 'org.slf4j.helpers.FormattingTuple', - 'org.slf4j.helpers.MessageFormatter', - 'org.slf4j.Logger', - 'org.slf4j.LoggerFactory', - 'org.slf4j.spi.LocationAwareLogger', + // from io.netty.util.internal.logging.InternalLoggerFactory (netty) - it's optional + 'org.slf4j.helpers.FormattingTuple', + 'org.slf4j.helpers.MessageFormatter', + 'org.slf4j.Logger', + 'org.slf4j.LoggerFactory', + 'org.slf4j.spi.LocationAwareLogger', - 'com.google.protobuf.ExtensionRegistryLite', - 'com.google.protobuf.MessageLiteOrBuilder', - 'com.google.protobuf.nano.CodedOutputByteBufferNano', - 'com.google.protobuf.nano.MessageNano', - 'com.jcraft.jzlib.Deflater', - 'com.jcraft.jzlib.Inflater', - 'com.jcraft.jzlib.JZlib$WrapperType', - 'com.jcraft.jzlib.JZlib', - 'com.ning.compress.BufferRecycler', - 'com.ning.compress.lzf.ChunkDecoder', - 'com.ning.compress.lzf.ChunkEncoder', - 'com.ning.compress.lzf.LZFEncoder', - 'com.ning.compress.lzf.util.ChunkDecoderFactory', - 'com.ning.compress.lzf.util.ChunkEncoderFactory', - 'lzma.sdk.lzma.Encoder', - 'net.jpountz.lz4.LZ4Compressor', - 'net.jpountz.lz4.LZ4Factory', - 'net.jpountz.lz4.LZ4FastDecompressor', - 'net.jpountz.xxhash.XXHash32', - 'net.jpountz.xxhash.XXHashFactory', - 'io.netty.internal.tcnative.CertificateCallback', - 'io.netty.internal.tcnative.CertificateVerifier', - 'io.netty.internal.tcnative.SessionTicketKey', - 'io.netty.internal.tcnative.SniHostNameMatcher', - 'io.netty.internal.tcnative.SSL', - 'org.eclipse.jetty.alpn.ALPN$ClientProvider', - 'org.eclipse.jetty.alpn.ALPN$ServerProvider', - 'org.eclipse.jetty.alpn.ALPN', + 'com.google.protobuf.ExtensionRegistryLite', + 'com.google.protobuf.MessageLiteOrBuilder', + 'com.google.protobuf.nano.CodedOutputByteBufferNano', + 'com.google.protobuf.nano.MessageNano', + 'com.jcraft.jzlib.Deflater', + 'com.jcraft.jzlib.Inflater', + 'com.jcraft.jzlib.JZlib$WrapperType', + 'com.jcraft.jzlib.JZlib', + 'com.ning.compress.BufferRecycler', + 'com.ning.compress.lzf.ChunkDecoder', + 'com.ning.compress.lzf.ChunkEncoder', + 'com.ning.compress.lzf.LZFEncoder', + 'com.ning.compress.lzf.util.ChunkDecoderFactory', + 'com.ning.compress.lzf.util.ChunkEncoderFactory', + 'lzma.sdk.lzma.Encoder', + 'net.jpountz.lz4.LZ4Compressor', + 'net.jpountz.lz4.LZ4Factory', + 'net.jpountz.lz4.LZ4FastDecompressor', + 'net.jpountz.xxhash.XXHash32', + 'net.jpountz.xxhash.XXHashFactory', + 'io.netty.internal.tcnative.CertificateCallback', + 'io.netty.internal.tcnative.CertificateVerifier', + 'io.netty.internal.tcnative.SessionTicketKey', + 'io.netty.internal.tcnative.SniHostNameMatcher', + 'io.netty.internal.tcnative.SSL', + 'org.eclipse.jetty.alpn.ALPN$ClientProvider', + 'org.eclipse.jetty.alpn.ALPN$ServerProvider', + 'org.eclipse.jetty.alpn.ALPN', - 'org.conscrypt.AllocatedBuffer', - 'org.conscrypt.BufferAllocator', - 'org.conscrypt.Conscrypt', - 'org.conscrypt.HandshakeListener' - ) + 'org.conscrypt.AllocatedBuffer', + 'org.conscrypt.BufferAllocator', + 'org.conscrypt.Conscrypt', + 'org.conscrypt.HandshakeListener' + ) - ignoreViolations ( - 'io.netty.util.internal.PlatformDependent0', - 'io.netty.util.internal.PlatformDependent0$1', - 'io.netty.util.internal.PlatformDependent0$2', - 'io.netty.util.internal.PlatformDependent0$3', - 'io.netty.util.internal.PlatformDependent0$5', - 'io.netty.util.internal.shaded.org.jctools.queues.BaseLinkedQueueConsumerNodeRef', - 'io.netty.util.internal.shaded.org.jctools.queues.BaseLinkedQueueProducerNodeRef', - 'io.netty.util.internal.shaded.org.jctools.queues.BaseMpscLinkedArrayQueueColdProducerFields', - 'io.netty.util.internal.shaded.org.jctools.queues.BaseMpscLinkedArrayQueueConsumerFields', - 'io.netty.util.internal.shaded.org.jctools.queues.BaseMpscLinkedArrayQueueProducerFields', - 'io.netty.util.internal.shaded.org.jctools.queues.LinkedQueueNode', - 'io.netty.util.internal.shaded.org.jctools.queues.MpscArrayQueueConsumerIndexField', - 'io.netty.util.internal.shaded.org.jctools.queues.MpscArrayQueueProducerIndexField', - 'io.netty.util.internal.shaded.org.jctools.queues.MpscArrayQueueProducerLimitField', - 'io.netty.util.internal.shaded.org.jctools.util.UnsafeAccess', - 'io.netty.util.internal.shaded.org.jctools.util.UnsafeRefArrayAccess', - 'io.netty.handler.ssl.util.OpenJdkSelfSignedCertGenerator' - ) + ignoreViolations( + 'io.netty.util.internal.PlatformDependent0', + 'io.netty.util.internal.PlatformDependent0$1', + 'io.netty.util.internal.PlatformDependent0$2', + 'io.netty.util.internal.PlatformDependent0$3', + 'io.netty.util.internal.PlatformDependent0$5', + 'io.netty.util.internal.shaded.org.jctools.queues.BaseLinkedQueueConsumerNodeRef', + 'io.netty.util.internal.shaded.org.jctools.queues.BaseLinkedQueueProducerNodeRef', + 'io.netty.util.internal.shaded.org.jctools.queues.BaseMpscLinkedArrayQueueColdProducerFields', + 'io.netty.util.internal.shaded.org.jctools.queues.BaseMpscLinkedArrayQueueConsumerFields', + 'io.netty.util.internal.shaded.org.jctools.queues.BaseMpscLinkedArrayQueueProducerFields', + 'io.netty.util.internal.shaded.org.jctools.queues.LinkedQueueNode', + 'io.netty.util.internal.shaded.org.jctools.queues.MpscArrayQueueConsumerIndexField', + 'io.netty.util.internal.shaded.org.jctools.queues.MpscArrayQueueProducerIndexField', + 'io.netty.util.internal.shaded.org.jctools.queues.MpscArrayQueueProducerLimitField', + 'io.netty.util.internal.shaded.org.jctools.util.UnsafeAccess', + 'io.netty.util.internal.shaded.org.jctools.util.UnsafeRefArrayAccess', + 'io.netty.handler.ssl.util.OpenJdkSelfSignedCertGenerator' + ) } rootProject.globalInfo.ready { - if (BuildParams.inFipsJvm == false) { - // BouncyCastleFIPS provides this class, so the exclusion is invalid when running CI in - // a FIPS JVM with BouncyCastleFIPS Provider - thirdPartyAudit.ignoreMissingClasses( - 'org.bouncycastle.asn1.x500.X500Name' - ) - } + if (BuildParams.inFipsJvm == false) { + // BouncyCastleFIPS provides this class, so the exclusion is invalid when running CI in + // a FIPS JVM with BouncyCastleFIPS Provider + thirdPartyAudit.ignoreMissingClasses( + 'org.bouncycastle.asn1.x500.X500Name' + ) + } } diff --git a/plugins/analysis-ukrainian/build.gradle b/plugins/analysis-ukrainian/build.gradle index 1f97bced919..0e254e5f050 100644 --- a/plugins/analysis-ukrainian/build.gradle +++ b/plugins/analysis-ukrainian/build.gradle @@ -34,7 +34,7 @@ dependencyLicenses { mapping from: /morfologik-.*/, to: 'lucene' } -thirdPartyAudit.ignoreMissingClasses ( +thirdPartyAudit.ignoreMissingClasses( // we don't use the morfologik-fsa polish stemmer 'morfologik.stemming.polish.PolishStemmer' ) diff --git a/plugins/build.gradle b/plugins/build.gradle index 2aee6cafffa..25bd06b8f74 100644 --- a/plugins/build.gradle +++ b/plugins/build.gradle @@ -17,8 +17,8 @@ * under the License. */ -subprojects { - apply plugin: 'elasticsearch.testclusters' +subprojects { + apply plugin: 'elasticsearch.testclusters' } // only configure immediate children of plugins dir @@ -29,7 +29,7 @@ configure(subprojects.findAll { it.parent.path == project.path }) { esplugin { // for local ES plugins, the name of the plugin is the same as the directory name project.name - + licenseFile rootProject.file('licenses/APACHE-LICENSE-2.0.txt') noticeFile rootProject.file('NOTICE.txt') } diff --git a/plugins/discovery-azure-classic/build.gradle b/plugins/discovery-azure-classic/build.gradle index c83cd96c101..3dfeef72fb9 100644 --- a/plugins/discovery-azure-classic/build.gradle +++ b/plugins/discovery-azure-classic/build.gradle @@ -45,12 +45,12 @@ dependencies { compile "com.sun.jersey:jersey-client:${versions.jersey}" compile "com.sun.jersey:jersey-core:${versions.jersey}" compile "com.sun.jersey:jersey-json:${versions.jersey}" - compile 'org.codehaus.jettison:jettison:1.1' + compile 'org.codehaus.jettison:jettison:1.1' compile 'com.sun.xml.bind:jaxb-impl:2.2.3-1' compile 'org.codehaus.jackson:jackson-core-asl:1.9.2' compile 'org.codehaus.jackson:jackson-mapper-asl:1.9.2' compile 'org.codehaus.jackson:jackson-jaxrs:1.9.2' - compile 'org.codehaus.jackson:jackson-xc:1.9.2' + compile 'org.codehaus.jackson:jackson-xc:1.9.2' // HACK: javax.xml.bind was removed from default modules in java 9, so we pull the api in here, // and whitelist this hack in JarHell @@ -73,14 +73,14 @@ task createKey(type: LoggedExec) { executable = "${BuildParams.runtimeJavaHome}/bin/keytool" standardInput = new ByteArrayInputStream('FirstName LastName\nUnit\nOrganization\nCity\nState\nNL\nyes\n\n'.getBytes('UTF-8')) args '-genkey', - '-alias', 'test-node', - '-keystore', keystore, - '-keyalg', 'RSA', - '-keysize', '2048', - '-validity', '712', - '-dname', 'CN=' + host, - '-keypass', 'keypass', - '-storepass', 'keypass' + '-alias', 'test-node', + '-keystore', keystore, + '-keyalg', 'RSA', + '-keysize', '2048', + '-validity', '712', + '-dname', 'CN=' + host, + '-keypass', 'keypass', + '-storepass', 'keypass' } // add keystore to test classpath: it expects it there @@ -101,38 +101,38 @@ dependencyLicenses { mapping from: /jaxb-.*/, to: 'jaxb' } -thirdPartyAudit.ignoreMissingClasses ( - 'javax.servlet.ServletContextEvent', - 'javax.servlet.ServletContextListener', - 'org.apache.avalon.framework.logger.Logger', - 'org.apache.log.Hierarchy', - 'org.apache.log.Logger', - 'org.eclipse.persistence.descriptors.ClassDescriptor', - 'org.eclipse.persistence.internal.oxm.MappingNodeValue', - 'org.eclipse.persistence.internal.oxm.TreeObjectBuilder', - 'org.eclipse.persistence.internal.oxm.XPathFragment', - 'org.eclipse.persistence.internal.oxm.XPathNode', - 'org.eclipse.persistence.internal.queries.ContainerPolicy', - 'org.eclipse.persistence.jaxb.JAXBContext', - 'org.eclipse.persistence.jaxb.JAXBHelper', - 'org.eclipse.persistence.mappings.DatabaseMapping', - 'org.eclipse.persistence.mappings.converters.TypeConversionConverter', - 'org.eclipse.persistence.mappings.foundation.AbstractCompositeDirectCollectionMapping', - 'org.eclipse.persistence.oxm.XMLContext', - 'org.eclipse.persistence.oxm.XMLDescriptor', - 'org.eclipse.persistence.oxm.XMLField', - 'org.eclipse.persistence.oxm.mappings.XMLCompositeCollectionMapping', - 'org.eclipse.persistence.sessions.DatabaseSession', - 'org.jvnet.fastinfoset.VocabularyApplicationData', - 'org.jvnet.staxex.Base64Data', - 'org.jvnet.staxex.XMLStreamReaderEx', - 'org.jvnet.staxex.XMLStreamWriterEx', - 'org.osgi.framework.Bundle', - 'org.osgi.framework.BundleActivator', - 'org.osgi.framework.BundleContext', - 'org.osgi.framework.BundleEvent', +thirdPartyAudit.ignoreMissingClasses( + 'javax.servlet.ServletContextEvent', + 'javax.servlet.ServletContextListener', + 'org.apache.avalon.framework.logger.Logger', + 'org.apache.log.Hierarchy', + 'org.apache.log.Logger', + 'org.eclipse.persistence.descriptors.ClassDescriptor', + 'org.eclipse.persistence.internal.oxm.MappingNodeValue', + 'org.eclipse.persistence.internal.oxm.TreeObjectBuilder', + 'org.eclipse.persistence.internal.oxm.XPathFragment', + 'org.eclipse.persistence.internal.oxm.XPathNode', + 'org.eclipse.persistence.internal.queries.ContainerPolicy', + 'org.eclipse.persistence.jaxb.JAXBContext', + 'org.eclipse.persistence.jaxb.JAXBHelper', + 'org.eclipse.persistence.mappings.DatabaseMapping', + 'org.eclipse.persistence.mappings.converters.TypeConversionConverter', + 'org.eclipse.persistence.mappings.foundation.AbstractCompositeDirectCollectionMapping', + 'org.eclipse.persistence.oxm.XMLContext', + 'org.eclipse.persistence.oxm.XMLDescriptor', + 'org.eclipse.persistence.oxm.XMLField', + 'org.eclipse.persistence.oxm.mappings.XMLCompositeCollectionMapping', + 'org.eclipse.persistence.sessions.DatabaseSession', + 'org.jvnet.fastinfoset.VocabularyApplicationData', + 'org.jvnet.staxex.Base64Data', + 'org.jvnet.staxex.XMLStreamReaderEx', + 'org.jvnet.staxex.XMLStreamWriterEx', + 'org.osgi.framework.Bundle', + 'org.osgi.framework.BundleActivator', + 'org.osgi.framework.BundleContext', + 'org.osgi.framework.BundleEvent', 'org.osgi.framework.SynchronousBundleListener', - 'com.sun.xml.fastinfoset.stax.StAXDocumentParser', + 'com.sun.xml.fastinfoset.stax.StAXDocumentParser', 'com.sun.xml.fastinfoset.stax.StAXDocumentSerializer' ) @@ -140,118 +140,118 @@ thirdPartyAudit.ignoreMissingClasses ( rootProject.globalInfo.ready { if (BuildParams.runtimeJavaVersion <= JavaVersion.VERSION_1_8) { thirdPartyAudit.ignoreJarHellWithJDK( - 'javax.xml.bind.Binder', - 'javax.xml.bind.ContextFinder$1', - 'javax.xml.bind.ContextFinder', - 'javax.xml.bind.DataBindingException', - 'javax.xml.bind.DatatypeConverter', - 'javax.xml.bind.DatatypeConverterImpl$CalendarFormatter', - 'javax.xml.bind.DatatypeConverterImpl', - 'javax.xml.bind.DatatypeConverterInterface', - 'javax.xml.bind.Element', - 'javax.xml.bind.GetPropertyAction', - 'javax.xml.bind.JAXB$Cache', - 'javax.xml.bind.JAXB', - 'javax.xml.bind.JAXBContext', - 'javax.xml.bind.JAXBElement$GlobalScope', - 'javax.xml.bind.JAXBElement', - 'javax.xml.bind.JAXBException', - 'javax.xml.bind.JAXBIntrospector', - 'javax.xml.bind.JAXBPermission', - 'javax.xml.bind.MarshalException', - 'javax.xml.bind.Marshaller$Listener', - 'javax.xml.bind.Marshaller', - 'javax.xml.bind.Messages', - 'javax.xml.bind.NotIdentifiableEvent', - 'javax.xml.bind.ParseConversionEvent', - 'javax.xml.bind.PrintConversionEvent', - 'javax.xml.bind.PropertyException', - 'javax.xml.bind.SchemaOutputResolver', - 'javax.xml.bind.TypeConstraintException', - 'javax.xml.bind.UnmarshalException', - 'javax.xml.bind.Unmarshaller$Listener', - 'javax.xml.bind.Unmarshaller', - 'javax.xml.bind.UnmarshallerHandler', - 'javax.xml.bind.ValidationEvent', - 'javax.xml.bind.ValidationEventHandler', - 'javax.xml.bind.ValidationEventLocator', - 'javax.xml.bind.ValidationException', - 'javax.xml.bind.Validator', - 'javax.xml.bind.WhiteSpaceProcessor', - 'javax.xml.bind.annotation.DomHandler', - 'javax.xml.bind.annotation.W3CDomHandler', - 'javax.xml.bind.annotation.XmlAccessOrder', - 'javax.xml.bind.annotation.XmlAccessType', - 'javax.xml.bind.annotation.XmlAccessorOrder', - 'javax.xml.bind.annotation.XmlAccessorType', - 'javax.xml.bind.annotation.XmlAnyAttribute', - 'javax.xml.bind.annotation.XmlAnyElement', - 'javax.xml.bind.annotation.XmlAttachmentRef', - 'javax.xml.bind.annotation.XmlAttribute', - 'javax.xml.bind.annotation.XmlElement$DEFAULT', - 'javax.xml.bind.annotation.XmlElement', - 'javax.xml.bind.annotation.XmlElementDecl$GLOBAL', - 'javax.xml.bind.annotation.XmlElementDecl', - 'javax.xml.bind.annotation.XmlElementRef$DEFAULT', - 'javax.xml.bind.annotation.XmlElementRef', - 'javax.xml.bind.annotation.XmlElementRefs', - 'javax.xml.bind.annotation.XmlElementWrapper', - 'javax.xml.bind.annotation.XmlElements', - 'javax.xml.bind.annotation.XmlEnum', - 'javax.xml.bind.annotation.XmlEnumValue', - 'javax.xml.bind.annotation.XmlID', - 'javax.xml.bind.annotation.XmlIDREF', - 'javax.xml.bind.annotation.XmlInlineBinaryData', - 'javax.xml.bind.annotation.XmlList', - 'javax.xml.bind.annotation.XmlMimeType', - 'javax.xml.bind.annotation.XmlMixed', - 'javax.xml.bind.annotation.XmlNs', - 'javax.xml.bind.annotation.XmlNsForm', - 'javax.xml.bind.annotation.XmlRegistry', - 'javax.xml.bind.annotation.XmlRootElement', - 'javax.xml.bind.annotation.XmlSchema', - 'javax.xml.bind.annotation.XmlSchemaType$DEFAULT', - 'javax.xml.bind.annotation.XmlSchemaType', - 'javax.xml.bind.annotation.XmlSchemaTypes', - 'javax.xml.bind.annotation.XmlSeeAlso', - 'javax.xml.bind.annotation.XmlTransient', - 'javax.xml.bind.annotation.XmlType$DEFAULT', - 'javax.xml.bind.annotation.XmlType', - 'javax.xml.bind.annotation.XmlValue', - 'javax.xml.bind.annotation.adapters.CollapsedStringAdapter', - 'javax.xml.bind.annotation.adapters.HexBinaryAdapter', - 'javax.xml.bind.annotation.adapters.NormalizedStringAdapter', - 'javax.xml.bind.annotation.adapters.XmlAdapter', - 'javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter$DEFAULT', - 'javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter', - 'javax.xml.bind.annotation.adapters.XmlJavaTypeAdapters', - 'javax.xml.bind.attachment.AttachmentMarshaller', - 'javax.xml.bind.attachment.AttachmentUnmarshaller', - 'javax.xml.bind.helpers.AbstractMarshallerImpl', - 'javax.xml.bind.helpers.AbstractUnmarshallerImpl', - 'javax.xml.bind.helpers.DefaultValidationEventHandler', - 'javax.xml.bind.helpers.Messages', - 'javax.xml.bind.helpers.NotIdentifiableEventImpl', - 'javax.xml.bind.helpers.ParseConversionEventImpl', - 'javax.xml.bind.helpers.PrintConversionEventImpl', - 'javax.xml.bind.helpers.ValidationEventImpl', - 'javax.xml.bind.helpers.ValidationEventLocatorImpl', - 'javax.xml.bind.util.JAXBResult', - 'javax.xml.bind.util.JAXBSource$1', - 'javax.xml.bind.util.JAXBSource', - 'javax.xml.bind.util.Messages', - 'javax.xml.bind.util.ValidationEventCollector' + 'javax.xml.bind.Binder', + 'javax.xml.bind.ContextFinder$1', + 'javax.xml.bind.ContextFinder', + 'javax.xml.bind.DataBindingException', + 'javax.xml.bind.DatatypeConverter', + 'javax.xml.bind.DatatypeConverterImpl$CalendarFormatter', + 'javax.xml.bind.DatatypeConverterImpl', + 'javax.xml.bind.DatatypeConverterInterface', + 'javax.xml.bind.Element', + 'javax.xml.bind.GetPropertyAction', + 'javax.xml.bind.JAXB$Cache', + 'javax.xml.bind.JAXB', + 'javax.xml.bind.JAXBContext', + 'javax.xml.bind.JAXBElement$GlobalScope', + 'javax.xml.bind.JAXBElement', + 'javax.xml.bind.JAXBException', + 'javax.xml.bind.JAXBIntrospector', + 'javax.xml.bind.JAXBPermission', + 'javax.xml.bind.MarshalException', + 'javax.xml.bind.Marshaller$Listener', + 'javax.xml.bind.Marshaller', + 'javax.xml.bind.Messages', + 'javax.xml.bind.NotIdentifiableEvent', + 'javax.xml.bind.ParseConversionEvent', + 'javax.xml.bind.PrintConversionEvent', + 'javax.xml.bind.PropertyException', + 'javax.xml.bind.SchemaOutputResolver', + 'javax.xml.bind.TypeConstraintException', + 'javax.xml.bind.UnmarshalException', + 'javax.xml.bind.Unmarshaller$Listener', + 'javax.xml.bind.Unmarshaller', + 'javax.xml.bind.UnmarshallerHandler', + 'javax.xml.bind.ValidationEvent', + 'javax.xml.bind.ValidationEventHandler', + 'javax.xml.bind.ValidationEventLocator', + 'javax.xml.bind.ValidationException', + 'javax.xml.bind.Validator', + 'javax.xml.bind.WhiteSpaceProcessor', + 'javax.xml.bind.annotation.DomHandler', + 'javax.xml.bind.annotation.W3CDomHandler', + 'javax.xml.bind.annotation.XmlAccessOrder', + 'javax.xml.bind.annotation.XmlAccessType', + 'javax.xml.bind.annotation.XmlAccessorOrder', + 'javax.xml.bind.annotation.XmlAccessorType', + 'javax.xml.bind.annotation.XmlAnyAttribute', + 'javax.xml.bind.annotation.XmlAnyElement', + 'javax.xml.bind.annotation.XmlAttachmentRef', + 'javax.xml.bind.annotation.XmlAttribute', + 'javax.xml.bind.annotation.XmlElement$DEFAULT', + 'javax.xml.bind.annotation.XmlElement', + 'javax.xml.bind.annotation.XmlElementDecl$GLOBAL', + 'javax.xml.bind.annotation.XmlElementDecl', + 'javax.xml.bind.annotation.XmlElementRef$DEFAULT', + 'javax.xml.bind.annotation.XmlElementRef', + 'javax.xml.bind.annotation.XmlElementRefs', + 'javax.xml.bind.annotation.XmlElementWrapper', + 'javax.xml.bind.annotation.XmlElements', + 'javax.xml.bind.annotation.XmlEnum', + 'javax.xml.bind.annotation.XmlEnumValue', + 'javax.xml.bind.annotation.XmlID', + 'javax.xml.bind.annotation.XmlIDREF', + 'javax.xml.bind.annotation.XmlInlineBinaryData', + 'javax.xml.bind.annotation.XmlList', + 'javax.xml.bind.annotation.XmlMimeType', + 'javax.xml.bind.annotation.XmlMixed', + 'javax.xml.bind.annotation.XmlNs', + 'javax.xml.bind.annotation.XmlNsForm', + 'javax.xml.bind.annotation.XmlRegistry', + 'javax.xml.bind.annotation.XmlRootElement', + 'javax.xml.bind.annotation.XmlSchema', + 'javax.xml.bind.annotation.XmlSchemaType$DEFAULT', + 'javax.xml.bind.annotation.XmlSchemaType', + 'javax.xml.bind.annotation.XmlSchemaTypes', + 'javax.xml.bind.annotation.XmlSeeAlso', + 'javax.xml.bind.annotation.XmlTransient', + 'javax.xml.bind.annotation.XmlType$DEFAULT', + 'javax.xml.bind.annotation.XmlType', + 'javax.xml.bind.annotation.XmlValue', + 'javax.xml.bind.annotation.adapters.CollapsedStringAdapter', + 'javax.xml.bind.annotation.adapters.HexBinaryAdapter', + 'javax.xml.bind.annotation.adapters.NormalizedStringAdapter', + 'javax.xml.bind.annotation.adapters.XmlAdapter', + 'javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter$DEFAULT', + 'javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter', + 'javax.xml.bind.annotation.adapters.XmlJavaTypeAdapters', + 'javax.xml.bind.attachment.AttachmentMarshaller', + 'javax.xml.bind.attachment.AttachmentUnmarshaller', + 'javax.xml.bind.helpers.AbstractMarshallerImpl', + 'javax.xml.bind.helpers.AbstractUnmarshallerImpl', + 'javax.xml.bind.helpers.DefaultValidationEventHandler', + 'javax.xml.bind.helpers.Messages', + 'javax.xml.bind.helpers.NotIdentifiableEventImpl', + 'javax.xml.bind.helpers.ParseConversionEventImpl', + 'javax.xml.bind.helpers.PrintConversionEventImpl', + 'javax.xml.bind.helpers.ValidationEventImpl', + 'javax.xml.bind.helpers.ValidationEventLocatorImpl', + 'javax.xml.bind.util.JAXBResult', + 'javax.xml.bind.util.JAXBSource$1', + 'javax.xml.bind.util.JAXBSource', + 'javax.xml.bind.util.Messages', + 'javax.xml.bind.util.ValidationEventCollector' ) } else { thirdPartyAudit.ignoreMissingClasses( - 'javax.activation.ActivationDataFlavor', - 'javax.activation.DataContentHandler', - 'javax.activation.DataHandler', - 'javax.activation.DataSource', - 'javax.activation.FileDataSource', - 'javax.activation.FileTypeMap', - 'javax.activation.MimeType', - 'javax.activation.MimeTypeParseException', + 'javax.activation.ActivationDataFlavor', + 'javax.activation.DataContentHandler', + 'javax.activation.DataHandler', + 'javax.activation.DataSource', + 'javax.activation.FileDataSource', + 'javax.activation.FileTypeMap', + 'javax.activation.MimeType', + 'javax.activation.MimeTypeParseException', ) } -} \ No newline at end of file +} diff --git a/plugins/discovery-ec2/build.gradle b/plugins/discovery-ec2/build.gradle index 30465b01b38..c3c6d0b832d 100644 --- a/plugins/discovery-ec2/build.gradle +++ b/plugins/discovery-ec2/build.gradle @@ -59,11 +59,11 @@ task writeTestJavaPolicy { } final File javaPolicy = file("${tmp}/java.policy") javaPolicy.write( - [ - "grant {", - " permission java.util.PropertyPermission \"com.amazonaws.sdk.ec2MetadataServiceEndpointOverride\", \"write\";", - "};" - ].join("\n")) + [ + "grant {", + " permission java.util.PropertyPermission \"com.amazonaws.sdk.ec2MetadataServiceEndpointOverride\", \"write\";", + "};" + ].join("\n")) } } @@ -71,7 +71,7 @@ test { dependsOn writeTestJavaPolicy // this is needed for insecure plugins, remove if possible! systemProperty 'tests.artifact', project.name - + // this is needed to manipulate com.amazonaws.sdk.ec2MetadataServiceEndpointOverride system property // it is better rather disable security manager at all with `systemProperty 'tests.security.manager', 'false'` systemProperty 'java.security.policy', "file://${buildDir}/tmp/java.policy" @@ -82,7 +82,7 @@ check { dependsOn 'qa:amazon-ec2:check' } -thirdPartyAudit.ignoreMissingClasses ( +thirdPartyAudit.ignoreMissingClasses( // classes are missing 'com.amazonaws.jmespath.JmesPathEvaluationVisitor', 'com.amazonaws.jmespath.JmesPathExpression', @@ -104,18 +104,18 @@ thirdPartyAudit.ignoreMissingClasses ( 'software.amazon.ion.system.IonSystemBuilder', 'software.amazon.ion.system.IonTextWriterBuilder', 'software.amazon.ion.system.IonWriterBuilder', - 'javax.servlet.ServletContextEvent', - 'javax.servlet.ServletContextListener', - 'org.apache.avalon.framework.logger.Logger', - 'org.apache.log.Hierarchy', + 'javax.servlet.ServletContextEvent', + 'javax.servlet.ServletContextListener', + 'org.apache.avalon.framework.logger.Logger', + 'org.apache.log.Hierarchy', 'org.apache.log.Logger' ) rootProject.globalInfo.ready { if (BuildParams.runtimeJavaVersion > JavaVersion.VERSION_1_8) { thirdPartyAudit.ignoreMissingClasses( - 'javax.xml.bind.DatatypeConverter', - 'javax.xml.bind.JAXBContext' + 'javax.xml.bind.DatatypeConverter', + 'javax.xml.bind.JAXBContext' ) } } diff --git a/plugins/discovery-ec2/qa/amazon-ec2/build.gradle b/plugins/discovery-ec2/qa/amazon-ec2/build.gradle index 5257923ee80..023c864d62e 100644 --- a/plugins/discovery-ec2/qa/amazon-ec2/build.gradle +++ b/plugins/discovery-ec2/qa/amazon-ec2/build.gradle @@ -29,18 +29,18 @@ apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' dependencies { - testCompile project(path: ':plugins:discovery-ec2', configuration: 'runtime') + testCompile project(path: ':plugins:discovery-ec2', configuration: 'runtime') } final int ec2NumberOfNodes = 3 Map expansions = [ - 'expected_nodes': ec2NumberOfNodes + 'expected_nodes': ec2NumberOfNodes ] processTestResources { - inputs.properties(expansions) - MavenFilteringHack.filter(it, expansions) + inputs.properties(expansions) + MavenFilteringHack.filter(it, expansions) } // disable default test task, use spezialized ones below @@ -58,55 +58,55 @@ integTest.enabled = false * custom Java security policy to work. */ ['KeyStore', 'EnvVariables', 'SystemProperties', 'ContainerCredentials', 'InstanceProfile'].forEach { action -> - AntFixture fixture = tasks.create(name: "ec2Fixture${action}", type: AntFixture) { - dependsOn compileTestJava - env 'CLASSPATH', "${ -> project.sourceSets.test.runtimeClasspath.asPath }" - executable = "${BuildParams.runtimeJavaHome}/bin/java" - args 'org.elasticsearch.discovery.ec2.AmazonEC2Fixture', baseDir, "${buildDir}/testclusters/integTest${action}-1/config/unicast_hosts.txt" - } + AntFixture fixture = tasks.create(name: "ec2Fixture${action}", type: AntFixture) { + dependsOn compileTestJava + env 'CLASSPATH', "${-> project.sourceSets.test.runtimeClasspath.asPath}" + executable = "${BuildParams.runtimeJavaHome}/bin/java" + args 'org.elasticsearch.discovery.ec2.AmazonEC2Fixture', baseDir, "${buildDir}/testclusters/integTest${action}-1/config/unicast_hosts.txt" + } - tasks.create(name: "integTest${action}", type: RestIntegTestTask) { - dependsOn fixture, project(':plugins:discovery-ec2').bundlePlugin - } + tasks.create(name: "integTest${action}", type: RestIntegTestTask) { + dependsOn fixture, project(':plugins:discovery-ec2').bundlePlugin + } - check.dependsOn("integTest${action}") + check.dependsOn("integTest${action}") - testClusters."integTest${action}" { - numberOfNodes = ec2NumberOfNodes - plugin file(project(':plugins:discovery-ec2').bundlePlugin.archiveFile) + testClusters."integTest${action}" { + numberOfNodes = ec2NumberOfNodes + plugin file(project(':plugins:discovery-ec2').bundlePlugin.archiveFile) - setting 'discovery.seed_providers', 'ec2' - setting 'network.host', '_ec2_' - setting 'discovery.ec2.endpoint', { "http://${-> fixture.addressAndPort}" }, IGNORE_VALUE + setting 'discovery.seed_providers', 'ec2' + setting 'network.host', '_ec2_' + setting 'discovery.ec2.endpoint', { "http://${-> fixture.addressAndPort}" }, IGNORE_VALUE - systemProperty "com.amazonaws.sdk.ec2MetadataServiceEndpointOverride", { "http://${-> fixture.addressAndPort}" }, IGNORE_VALUE - } + systemProperty "com.amazonaws.sdk.ec2MetadataServiceEndpointOverride", { "http://${-> fixture.addressAndPort}" }, IGNORE_VALUE + } } // Extra config for KeyStore testClusters.integTestKeyStore { - keystore 'discovery.ec2.access_key', 'ec2_integration_test_access_key' - keystore 'discovery.ec2.secret_key', 'ec2_integration_test_secret_key' + keystore 'discovery.ec2.access_key', 'ec2_integration_test_access_key' + keystore 'discovery.ec2.secret_key', 'ec2_integration_test_secret_key' } // Extra config for EnvVariables testClusters.integTestEnvVariables { - environment 'AWS_ACCESS_KEY_ID', 'ec2_integration_test_access_key' - environment 'AWS_SECRET_ACCESS_KEY', 'ec2_integration_test_secret_key' + environment 'AWS_ACCESS_KEY_ID', 'ec2_integration_test_access_key' + environment 'AWS_SECRET_ACCESS_KEY', 'ec2_integration_test_secret_key' } // Extra config for SystemProperties testClusters.integTestSystemProperties { - systemProperty 'aws.accessKeyId', 'ec2_integration_test_access_key' - systemProperty 'aws.secretKey', 'ec2_integration_test_secret_key' + systemProperty 'aws.accessKeyId', 'ec2_integration_test_access_key' + systemProperty 'aws.secretKey', 'ec2_integration_test_secret_key' } // Extra config for ContainerCredentials ec2FixtureContainerCredentials.env 'ACTIVATE_CONTAINER_CREDENTIALS', true testClusters.integTestContainerCredentials { - environment 'AWS_CONTAINER_CREDENTIALS_FULL_URI', - { "http://${-> tasks.findByName("ec2FixtureContainerCredentials").addressAndPort}/ecs_credentials_endpoint" }, IGNORE_VALUE + environment 'AWS_CONTAINER_CREDENTIALS_FULL_URI', + { "http://${-> tasks.findByName("ec2FixtureContainerCredentials").addressAndPort}/ecs_credentials_endpoint" }, IGNORE_VALUE } // Extra config for InstanceProfile diff --git a/plugins/discovery-gce/build.gradle b/plugins/discovery-gce/build.gradle index 25baa4b17ce..7e5c29ff5c3 100644 --- a/plugins/discovery-gce/build.gradle +++ b/plugins/discovery-gce/build.gradle @@ -32,16 +32,16 @@ check { test { // this is needed for insecure plugins, remove if possible! - systemProperty 'tests.artifact', project.name + systemProperty 'tests.artifact', project.name } -thirdPartyAudit.ignoreMissingClasses ( +thirdPartyAudit.ignoreMissingClasses( // classes are missing - 'com.google.common.base.Splitter', - 'com.google.common.collect.Lists', - 'javax.servlet.ServletContextEvent', - 'javax.servlet.ServletContextListener', - 'org.apache.avalon.framework.logger.Logger', - 'org.apache.log.Hierarchy', + 'com.google.common.base.Splitter', + 'com.google.common.collect.Lists', + 'javax.servlet.ServletContextEvent', + 'javax.servlet.ServletContextListener', + 'org.apache.avalon.framework.logger.Logger', + 'org.apache.log.Hierarchy', 'org.apache.log.Logger' ) diff --git a/plugins/discovery-gce/qa/gce/build.gradle b/plugins/discovery-gce/qa/gce/build.gradle index 46e22add7bf..3a5bf84c7ba 100644 --- a/plugins/discovery-gce/qa/gce/build.gradle +++ b/plugins/discovery-gce/qa/gce/build.gradle @@ -30,41 +30,41 @@ apply plugin: 'elasticsearch.rest-test' final int gceNumberOfNodes = 3 dependencies { - testCompile project(path: ':plugins:discovery-gce', configuration: 'runtime') + testCompile project(path: ':plugins:discovery-gce', configuration: 'runtime') } /** A task to start the GCEFixture which emulates a GCE service **/ task gceFixture(type: AntFixture) { - dependsOn compileTestJava - env 'CLASSPATH', "${ -> project.sourceSets.test.runtimeClasspath.asPath }" - executable = "${BuildParams.runtimeJavaHome}/bin/java" - args 'org.elasticsearch.cloud.gce.GCEFixture', baseDir, "${buildDir}/testclusters/integTest-1/config/unicast_hosts.txt" + dependsOn compileTestJava + env 'CLASSPATH', "${-> project.sourceSets.test.runtimeClasspath.asPath}" + executable = "${BuildParams.runtimeJavaHome}/bin/java" + args 'org.elasticsearch.cloud.gce.GCEFixture', baseDir, "${buildDir}/testclusters/integTest-1/config/unicast_hosts.txt" } Map expansions = [ - 'expected_nodes': gceNumberOfNodes + 'expected_nodes': gceNumberOfNodes ] processTestResources { - inputs.properties(expansions) - MavenFilteringHack.filter(it, expansions) + inputs.properties(expansions) + MavenFilteringHack.filter(it, expansions) } integTest { - dependsOn gceFixture, project(':plugins:discovery-gce').bundlePlugin + dependsOn gceFixture, project(':plugins:discovery-gce').bundlePlugin } testClusters.integTest { - numberOfNodes = gceNumberOfNodes - plugin file(project(':plugins:discovery-gce').bundlePlugin.archiveFile) - // use gce fixture for Auth calls instead of http://metadata.google.internal - environment 'GCE_METADATA_HOST', { "http://${gceFixture.addressAndPort}" }, IGNORE_VALUE - // allows to configure hidden settings (`cloud.gce.host` and `cloud.gce.root_url`) - systemProperty 'es.allow_reroute_gce_settings', 'true' + numberOfNodes = gceNumberOfNodes + plugin file(project(':plugins:discovery-gce').bundlePlugin.archiveFile) + // use gce fixture for Auth calls instead of http://metadata.google.internal + environment 'GCE_METADATA_HOST', { "http://${gceFixture.addressAndPort}" }, IGNORE_VALUE + // allows to configure hidden settings (`cloud.gce.host` and `cloud.gce.root_url`) + systemProperty 'es.allow_reroute_gce_settings', 'true' - setting 'discovery.seed_providers', 'gce' - // use gce fixture for metadata server calls instead of http://metadata.google.internal - setting 'cloud.gce.host', { "http://${gceFixture.addressAndPort}" }, IGNORE_VALUE - // use gce fixture for API calls instead of https://www.googleapis.com - setting 'cloud.gce.root_url', { "http://${gceFixture.addressAndPort}" }, IGNORE_VALUE + setting 'discovery.seed_providers', 'gce' + // use gce fixture for metadata server calls instead of http://metadata.google.internal + setting 'cloud.gce.host', { "http://${gceFixture.addressAndPort}" }, IGNORE_VALUE + // use gce fixture for API calls instead of https://www.googleapis.com + setting 'cloud.gce.root_url', { "http://${gceFixture.addressAndPort}" }, IGNORE_VALUE } diff --git a/plugins/examples/build.gradle b/plugins/examples/build.gradle index cd2739f035f..a122058b9a3 100644 --- a/plugins/examples/build.gradle +++ b/plugins/examples/build.gradle @@ -9,20 +9,20 @@ gradle.projectsEvaluated { } configure(project('painless-whitelist')) { - configurations.all { - resolutionStrategy.dependencySubstitution { - substitute module('org.elasticsearch.plugin:elasticsearch-scripting-painless-spi') with project(':modules:lang-painless:spi') - substitute module('org.elasticsearch.test:logger-usage') with project(':test:logger-usage') - } + configurations.all { + resolutionStrategy.dependencySubstitution { + substitute module('org.elasticsearch.plugin:elasticsearch-scripting-painless-spi') with project(':modules:lang-painless:spi') + substitute module('org.elasticsearch.test:logger-usage') with project(':test:logger-usage') } + } } configure(project('security-authorization-engine')) { - configurations.all { - resolutionStrategy.dependencySubstitution { - substitute module('org.elasticsearch.plugin:x-pack-core') with project(':x-pack:plugin:core') - substitute module('org.elasticsearch.client:x-pack-transport') with project(':x-pack:transport-client') - substitute module('org.elasticsearch.test:logger-usage') with project(':test:logger-usage') - } + configurations.all { + resolutionStrategy.dependencySubstitution { + substitute module('org.elasticsearch.plugin:x-pack-core') with project(':x-pack:plugin:core') + substitute module('org.elasticsearch.client:x-pack-transport') with project(':x-pack:transport-client') + substitute module('org.elasticsearch.test:logger-usage') with project(':test:logger-usage') } -} \ No newline at end of file + } +} diff --git a/plugins/examples/custom-suggester/build.gradle b/plugins/examples/custom-suggester/build.gradle index a6861c8be63..1966d8285b1 100644 --- a/plugins/examples/custom-suggester/build.gradle +++ b/plugins/examples/custom-suggester/build.gradle @@ -20,15 +20,15 @@ apply plugin: 'elasticsearch.testclusters' apply plugin: 'elasticsearch.esplugin' esplugin { - name 'custom-suggester' - description 'An example plugin showing how to write and register a custom suggester' - classname 'org.elasticsearch.example.customsuggester.CustomSuggesterPlugin' - licenseFile rootProject.file('licenses/APACHE-LICENSE-2.0.txt') - noticeFile rootProject.file('NOTICE.txt') + name 'custom-suggester' + description 'An example plugin showing how to write and register a custom suggester' + classname 'org.elasticsearch.example.customsuggester.CustomSuggesterPlugin' + licenseFile rootProject.file('licenses/APACHE-LICENSE-2.0.txt') + noticeFile rootProject.file('NOTICE.txt') } testClusters.integTest { - numberOfNodes = 2 + numberOfNodes = 2 } // this plugin has no unit tests, only rest tests diff --git a/plugins/examples/rest-handler/build.gradle b/plugins/examples/rest-handler/build.gradle index 8f454fd50fa..12f3c0e0953 100644 --- a/plugins/examples/rest-handler/build.gradle +++ b/plugins/examples/rest-handler/build.gradle @@ -34,7 +34,7 @@ test.enabled = false task exampleFixture(type: org.elasticsearch.gradle.test.AntFixture) { dependsOn testClasses - env 'CLASSPATH', "${ -> project.sourceSets.test.runtimeClasspath.asPath }" + env 'CLASSPATH', "${-> project.sourceSets.test.runtimeClasspath.asPath}" executable = "${BuildParams.runtimeJavaHome}/bin/java" args 'org.elasticsearch.example.resthandler.ExampleFixture', baseDir, 'TEST' } @@ -42,7 +42,7 @@ task exampleFixture(type: org.elasticsearch.gradle.test.AntFixture) { integTest { dependsOn exampleFixture runner { - nonInputProperties.systemProperty 'external.address', "${ -> exampleFixture.addressAndPort }" + nonInputProperties.systemProperty 'external.address', "${-> exampleFixture.addressAndPort}" } } @@ -50,4 +50,4 @@ testingConventions.naming { IT { baseClass 'org.elasticsearch.test.ESTestCase' } -} \ No newline at end of file +} diff --git a/plugins/ingest-attachment/build.gradle b/plugins/ingest-attachment/build.gradle index 8bd7c8e2d39..edc08c6650c 100644 --- a/plugins/ingest-attachment/build.gradle +++ b/plugins/ingest-attachment/build.gradle @@ -84,12 +84,12 @@ forbiddenPatterns { exclude '**/*.vsdx' } -thirdPartyAudit{ - ignoreMissingClasses() +thirdPartyAudit { + ignoreMissingClasses() } thirdPartyAudit.onlyIf { // FIPS JVM includes manny classes from bouncycastle which count as jar hell for the third party audit, // rather than provide a long list of exclusions, disable the check on FIPS. BuildParams.inFipsJvm == false -} \ No newline at end of file +} diff --git a/plugins/repository-azure/build.gradle b/plugins/repository-azure/build.gradle index 8a36d7b97af..4cc45d52a9c 100644 --- a/plugins/repository-azure/build.gradle +++ b/plugins/repository-azure/build.gradle @@ -41,26 +41,26 @@ dependencyLicenses { } thirdPartyAudit { - ignoreMissingClasses ( - // Optional and not enabled by Elasticsearch - 'org.slf4j.Logger', - 'org.slf4j.LoggerFactory' - ) + ignoreMissingClasses( + // Optional and not enabled by Elasticsearch + 'org.slf4j.Logger', + 'org.slf4j.LoggerFactory' + ) - ignoreViolations ( - // uses internal java api: sun.misc.Unsafe - 'com.google.common.cache.Striped64', - 'com.google.common.cache.Striped64$1', - 'com.google.common.cache.Striped64$Cell', - 'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray$1', - 'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray$2', - 'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray$3', - 'com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper', - 'com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper$1', - 'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray', - 'com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator', - 'com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator$1' - ) + ignoreViolations( + // uses internal java api: sun.misc.Unsafe + 'com.google.common.cache.Striped64', + 'com.google.common.cache.Striped64$1', + 'com.google.common.cache.Striped64$Cell', + 'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray$1', + 'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray$2', + 'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray$3', + 'com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper', + 'com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper$1', + 'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray', + 'com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator', + 'com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator$1' + ) } check { @@ -69,10 +69,10 @@ check { } testClusters { - integTest { - keystore 'azure.client.integration_test.account', 'azure_account' - keystore 'azure.client.integration_test.key', 'azure_key' - } + integTest { + keystore 'azure.client.integration_test.account', 'azure_account' + keystore 'azure.client.integration_test.key', 'azure_key' + } } String azureAccount = System.getenv("azure_storage_account") diff --git a/plugins/repository-azure/qa/microsoft-azure-storage/build.gradle b/plugins/repository-azure/qa/microsoft-azure-storage/build.gradle index 2425e71fc4a..529ee899fc8 100644 --- a/plugins/repository-azure/qa/microsoft-azure-storage/build.gradle +++ b/plugins/repository-azure/qa/microsoft-azure-storage/build.gradle @@ -40,49 +40,49 @@ String azureBasePath = System.getenv("azure_storage_base_path") String azureSasToken = System.getenv("azure_storage_sas_token") if (!azureAccount && !azureKey && !azureContainer && !azureBasePath && !azureSasToken) { - azureAccount = 'azure_integration_test_account' - azureKey = 'YXp1cmVfaW50ZWdyYXRpb25fdGVzdF9rZXk=' // The key is "azure_integration_test_key" encoded using base64 - azureContainer = 'container' - azureBasePath = '' - azureSasToken = '' - useFixture = true + azureAccount = 'azure_integration_test_account' + azureKey = 'YXp1cmVfaW50ZWdyYXRpb25fdGVzdF9rZXk=' // The key is "azure_integration_test_key" encoded using base64 + azureContainer = 'container' + azureBasePath = '' + azureSasToken = '' + useFixture = true } Map expansions = [ - 'container': azureContainer, - 'base_path': azureBasePath + "_integration_tests" + 'container': azureContainer, + 'base_path': azureBasePath + "_integration_tests" ] processTestResources { - inputs.properties(expansions) - MavenFilteringHack.filter(it, expansions) + inputs.properties(expansions) + MavenFilteringHack.filter(it, expansions) } integTest { - dependsOn project(':plugins:repository-azure').bundlePlugin -} + dependsOn project(':plugins:repository-azure').bundlePlugin +} testClusters.integTest { - plugin file(project(':plugins:repository-azure').bundlePlugin.archiveFile) - keystore 'azure.client.integration_test.account', azureAccount - if (azureKey != null && azureKey.isEmpty() == false) { - keystore 'azure.client.integration_test.key', azureKey - } - if (azureSasToken != null && azureSasToken.isEmpty() == false) { - keystore 'azure.client.integration_test.sas_token', azureSasToken - } + plugin file(project(':plugins:repository-azure').bundlePlugin.archiveFile) + keystore 'azure.client.integration_test.account', azureAccount + if (azureKey != null && azureKey.isEmpty() == false) { + keystore 'azure.client.integration_test.key', azureKey + } + if (azureSasToken != null && azureSasToken.isEmpty() == false) { + keystore 'azure.client.integration_test.sas_token', azureSasToken + } - if (useFixture) { - def azureAddress = { - int ephemeralPort = project(':test:fixtures:azure-fixture').postProcessFixture.ext."test.fixtures.azure-fixture.tcp.8091" - assert ephemeralPort > 0 - 'http://127.0.0.1:' + ephemeralPort - } - // Use a closure on the string to delay evaluation until tests are executed. The endpoint_suffix is used - // in a hacky way to change the protocol and endpoint. We must fix that. - setting 'azure.client.integration_test.endpoint_suffix', - { "ignored;DefaultEndpointsProtocol=http;BlobEndpoint=${ -> azureAddress() }" }, IGNORE_VALUE - String firstPartOfSeed = BuildParams.testSeed.tokenize(':').get(0) - setting 'thread_pool.repository_azure.max', (Math.abs(Long.parseUnsignedLong(firstPartOfSeed, 16) % 10) + 1).toString(), System.getProperty('ignore.tests.seed') == null ? DEFAULT : IGNORE_VALUE + if (useFixture) { + def azureAddress = { + int ephemeralPort = project(':test:fixtures:azure-fixture').postProcessFixture.ext."test.fixtures.azure-fixture.tcp.8091" + assert ephemeralPort > 0 + 'http://127.0.0.1:' + ephemeralPort } + // Use a closure on the string to delay evaluation until tests are executed. The endpoint_suffix is used + // in a hacky way to change the protocol and endpoint. We must fix that. + setting 'azure.client.integration_test.endpoint_suffix', + { "ignored;DefaultEndpointsProtocol=http;BlobEndpoint=${-> azureAddress()}" }, IGNORE_VALUE + String firstPartOfSeed = BuildParams.testSeed.tokenize(':').get(0) + setting 'thread_pool.repository_azure.max', (Math.abs(Long.parseUnsignedLong(firstPartOfSeed, 16) % 10) + 1).toString(), System.getProperty('ignore.tests.seed') == null ? DEFAULT : IGNORE_VALUE + } } diff --git a/plugins/repository-gcs/build.gradle b/plugins/repository-gcs/build.gradle index f75a1b66443..8a1cb2a136b 100644 --- a/plugins/repository-gcs/build.gradle +++ b/plugins/repository-gcs/build.gradle @@ -69,57 +69,57 @@ dependencyLicenses { } thirdPartyAudit { - ignoreViolations ( - // uses internal java api: sun.misc.Unsafe - 'com.google.protobuf.UnsafeUtil', - 'com.google.protobuf.UnsafeUtil$1', - 'com.google.protobuf.UnsafeUtil$JvmMemoryAccessor', - 'com.google.protobuf.UnsafeUtil$MemoryAccessor', - 'com.google.common.cache.Striped64', - 'com.google.common.cache.Striped64$1', - 'com.google.common.cache.Striped64$Cell', - 'com.google.common.hash.Striped64', - 'com.google.common.hash.Striped64$1', - 'com.google.common.hash.Striped64$Cell', - 'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray', - 'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray$1', - 'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray$2', - 'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray$3', - 'com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper', - 'com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper$1', - 'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray', - 'com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator', - 'com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator$1', - ) + ignoreViolations( + // uses internal java api: sun.misc.Unsafe + 'com.google.protobuf.UnsafeUtil', + 'com.google.protobuf.UnsafeUtil$1', + 'com.google.protobuf.UnsafeUtil$JvmMemoryAccessor', + 'com.google.protobuf.UnsafeUtil$MemoryAccessor', + 'com.google.common.cache.Striped64', + 'com.google.common.cache.Striped64$1', + 'com.google.common.cache.Striped64$Cell', + 'com.google.common.hash.Striped64', + 'com.google.common.hash.Striped64$1', + 'com.google.common.hash.Striped64$Cell', + 'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray', + 'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray$1', + 'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray$2', + 'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray$3', + 'com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper', + 'com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper$1', + 'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray', + 'com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator', + 'com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator$1', + ) - ignoreMissingClasses ( - 'com.google.appengine.api.datastore.Blob', - 'com.google.appengine.api.datastore.DatastoreService', - 'com.google.appengine.api.datastore.DatastoreServiceFactory', - 'com.google.appengine.api.datastore.Entity', - 'com.google.appengine.api.datastore.Key', - 'com.google.appengine.api.datastore.KeyFactory', - 'com.google.appengine.api.datastore.PreparedQuery', - 'com.google.appengine.api.datastore.Query', - 'com.google.appengine.api.memcache.Expiration', - 'com.google.appengine.api.memcache.MemcacheService', - 'com.google.appengine.api.memcache.MemcacheServiceFactory', - 'com.google.appengine.api.urlfetch.FetchOptions$Builder', - 'com.google.appengine.api.urlfetch.FetchOptions', - 'com.google.appengine.api.urlfetch.HTTPHeader', - 'com.google.appengine.api.urlfetch.HTTPMethod', - 'com.google.appengine.api.urlfetch.HTTPRequest', - 'com.google.appengine.api.urlfetch.HTTPResponse', - 'com.google.appengine.api.urlfetch.URLFetchService', - 'com.google.appengine.api.urlfetch.URLFetchServiceFactory', - // commons-logging optional dependencies - 'org.apache.avalon.framework.logger.Logger', - 'org.apache.log.Hierarchy', - 'org.apache.log.Logger', - // commons-logging provided dependencies - 'javax.servlet.ServletContextEvent', - 'javax.servlet.ServletContextListener' - ) + ignoreMissingClasses( + 'com.google.appengine.api.datastore.Blob', + 'com.google.appengine.api.datastore.DatastoreService', + 'com.google.appengine.api.datastore.DatastoreServiceFactory', + 'com.google.appengine.api.datastore.Entity', + 'com.google.appengine.api.datastore.Key', + 'com.google.appengine.api.datastore.KeyFactory', + 'com.google.appengine.api.datastore.PreparedQuery', + 'com.google.appengine.api.datastore.Query', + 'com.google.appengine.api.memcache.Expiration', + 'com.google.appengine.api.memcache.MemcacheService', + 'com.google.appengine.api.memcache.MemcacheServiceFactory', + 'com.google.appengine.api.urlfetch.FetchOptions$Builder', + 'com.google.appengine.api.urlfetch.FetchOptions', + 'com.google.appengine.api.urlfetch.HTTPHeader', + 'com.google.appengine.api.urlfetch.HTTPMethod', + 'com.google.appengine.api.urlfetch.HTTPRequest', + 'com.google.appengine.api.urlfetch.HTTPResponse', + 'com.google.appengine.api.urlfetch.URLFetchService', + 'com.google.appengine.api.urlfetch.URLFetchServiceFactory', + // commons-logging optional dependencies + 'org.apache.avalon.framework.logger.Logger', + 'org.apache.log.Hierarchy', + 'org.apache.log.Logger', + // commons-logging provided dependencies + 'javax.servlet.ServletContextEvent', + 'javax.servlet.ServletContextListener' + ) } check { diff --git a/plugins/repository-gcs/qa/google-cloud-storage/build.gradle b/plugins/repository-gcs/qa/google-cloud-storage/build.gradle index 25e43defd86..febba7837fb 100644 --- a/plugins/repository-gcs/qa/google-cloud-storage/build.gradle +++ b/plugins/repository-gcs/qa/google-cloud-storage/build.gradle @@ -33,7 +33,7 @@ apply plugin: 'elasticsearch.test.fixtures' // TODO think about flattening qa:google-cloud-storage project into parent dependencies { - testCompile project(path: ':plugins:repository-gcs') + testCompile project(path: ':plugins:repository-gcs') } testFixtures.useFixture(':test:fixtures:gcs-fixture') @@ -45,100 +45,100 @@ String gcsBasePath = System.getenv("google_storage_base_path") File serviceAccountFile = null if (!gcsServiceAccount && !gcsBucket && !gcsBasePath) { - serviceAccountFile = new File(project.buildDir, 'generated-resources/service_account_test.json') - gcsBucket = 'bucket' - gcsBasePath = 'integration_test' - useFixture = true + serviceAccountFile = new File(project.buildDir, 'generated-resources/service_account_test.json') + gcsBucket = 'bucket' + gcsBasePath = 'integration_test' + useFixture = true } else if (!gcsServiceAccount || !gcsBucket || !gcsBasePath) { - throw new IllegalArgumentException("not all options specified to run tests against external GCS service are present") + throw new IllegalArgumentException("not all options specified to run tests against external GCS service are present") } else { - serviceAccountFile = new File(gcsServiceAccount) + serviceAccountFile = new File(gcsServiceAccount) } def encodedCredentials = { - Base64.encoder.encodeToString(Files.readAllBytes(serviceAccountFile.toPath())) + Base64.encoder.encodeToString(Files.readAllBytes(serviceAccountFile.toPath())) } def fixtureAddress = { fixture -> - assert useFixture : 'closure should not be used without a fixture' - int ephemeralPort = project(':test:fixtures:gcs-fixture').postProcessFixture.ext."test.fixtures.${fixture}.tcp.80" - assert ephemeralPort > 0 - 'http://127.0.0.1:' + ephemeralPort + assert useFixture: 'closure should not be used without a fixture' + int ephemeralPort = project(':test:fixtures:gcs-fixture').postProcessFixture.ext."test.fixtures.${fixture}.tcp.80" + assert ephemeralPort > 0 + 'http://127.0.0.1:' + ephemeralPort } /** A service account file that points to the Google Cloud Storage service emulated by the fixture **/ task createServiceAccountFile() { - doLast { - KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA") - keyPairGenerator.initialize(1024) - KeyPair keyPair = keyPairGenerator.generateKeyPair() - String encodedKey = Base64.getEncoder().encodeToString(keyPair.private.getEncoded()) + doLast { + KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA") + keyPairGenerator.initialize(1024) + KeyPair keyPair = keyPairGenerator.generateKeyPair() + String encodedKey = Base64.getEncoder().encodeToString(keyPair.private.getEncoded()) - serviceAccountFile.parentFile.mkdirs() - serviceAccountFile.setText("{\n" + - ' "type": "service_account",\n' + - ' "project_id": "integration_test",\n' + - ' "private_key_id": "' + UUID.randomUUID().toString() + '",\n' + - ' "private_key": "-----BEGIN PRIVATE KEY-----\\n' + encodedKey + '\\n-----END PRIVATE KEY-----\\n",\n' + - ' "client_email": "integration_test@appspot.gserviceaccount.com",\n' + - ' "client_id": "123456789101112130594"\n' + - '}', 'UTF-8') - } + serviceAccountFile.parentFile.mkdirs() + serviceAccountFile.setText("{\n" + + ' "type": "service_account",\n' + + ' "project_id": "integration_test",\n' + + ' "private_key_id": "' + UUID.randomUUID().toString() + '",\n' + + ' "private_key": "-----BEGIN PRIVATE KEY-----\\n' + encodedKey + '\\n-----END PRIVATE KEY-----\\n",\n' + + ' "client_email": "integration_test@appspot.gserviceaccount.com",\n' + + ' "client_id": "123456789101112130594"\n' + + '}', 'UTF-8') + } } -task thirdPartyTest (type: Test) { - if (useFixture) { - thirdPartyTest.dependsOn createServiceAccountFile - nonInputProperties.systemProperty 'test.google.endpoint', "${ -> fixtureAddress('gcs-fixture-third-party') }" - nonInputProperties.systemProperty 'test.google.tokenURI', "${ -> fixtureAddress('gcs-fixture-third-party') }/o/oauth2/token" +task thirdPartyTest(type: Test) { + if (useFixture) { + thirdPartyTest.dependsOn createServiceAccountFile + nonInputProperties.systemProperty 'test.google.endpoint', "${-> fixtureAddress('gcs-fixture-third-party')}" + nonInputProperties.systemProperty 'test.google.tokenURI', "${-> fixtureAddress('gcs-fixture-third-party')}/o/oauth2/token" - gradle.taskGraph.whenReady { - if (it.hasTask(gcsThirdPartyTests)) { - throw new IllegalStateException("Tried to run third party tests but not all of the necessary environment variables " + - "'google_storage_service_account', 'google_storage_bucket', 'google_storage_base_path' are set.") - } - } + gradle.taskGraph.whenReady { + if (it.hasTask(gcsThirdPartyTests)) { + throw new IllegalStateException("Tried to run third party tests but not all of the necessary environment variables " + + "'google_storage_service_account', 'google_storage_bucket', 'google_storage_base_path' are set.") + } } + } - include '**/GoogleCloudStorageThirdPartyTests.class' - systemProperty 'tests.security.manager', false - systemProperty 'test.google.bucket', gcsBucket - systemProperty 'test.google.base', gcsBasePath + "_third_party_tests_" + BuildParams.testSeed - nonInputProperties.systemProperty 'test.google.account', "${ -> encodedCredentials.call() }" + include '**/GoogleCloudStorageThirdPartyTests.class' + systemProperty 'tests.security.manager', false + systemProperty 'test.google.bucket', gcsBucket + systemProperty 'test.google.base', gcsBasePath + "_third_party_tests_" + BuildParams.testSeed + nonInputProperties.systemProperty 'test.google.account', "${-> encodedCredentials.call()}" } task gcsThirdPartyTests { - dependsOn check + dependsOn check } integTest.mustRunAfter(thirdPartyTest) check.dependsOn thirdPartyTest Map expansions = [ - 'bucket': gcsBucket, - 'base_path': gcsBasePath + "_integration_tests" + 'bucket': gcsBucket, + 'base_path': gcsBasePath + "_integration_tests" ] processTestResources { - inputs.properties(expansions) - MavenFilteringHack.filter(it, expansions) + inputs.properties(expansions) + MavenFilteringHack.filter(it, expansions) } integTest { - dependsOn project(':plugins:repository-gcs').bundlePlugin + dependsOn project(':plugins:repository-gcs').bundlePlugin } testClusters.integTest { - plugin file(project(':plugins:repository-gcs').bundlePlugin.archiveFile) + plugin file(project(':plugins:repository-gcs').bundlePlugin.archiveFile) - keystore 'gcs.client.integration_test.credentials_file', serviceAccountFile, IGNORE_VALUE + keystore 'gcs.client.integration_test.credentials_file', serviceAccountFile, IGNORE_VALUE - if (useFixture) { - tasks.integTest.dependsOn createServiceAccountFile - /* Use a closure on the string to delay evaluation until tests are executed */ - setting 'gcs.client.integration_test.endpoint', { "${ -> fixtureAddress('gcs-fixture') }" }, IGNORE_VALUE - setting 'gcs.client.integration_test.token_uri', { "${ -> fixtureAddress('gcs-fixture') }/o/oauth2/token" }, IGNORE_VALUE - } else { - println "Using an external service to test the repository-gcs plugin" - } + if (useFixture) { + tasks.integTest.dependsOn createServiceAccountFile + /* Use a closure on the string to delay evaluation until tests are executed */ + setting 'gcs.client.integration_test.endpoint', { "${-> fixtureAddress('gcs-fixture')}" }, IGNORE_VALUE + setting 'gcs.client.integration_test.token_uri', { "${-> fixtureAddress('gcs-fixture')}/o/oauth2/token" }, IGNORE_VALUE + } else { + println "Using an external service to test the repository-gcs plugin" + } } diff --git a/plugins/repository-hdfs/build.gradle b/plugins/repository-hdfs/build.gradle index bc2b8acbed8..135debae6e8 100644 --- a/plugins/repository-hdfs/build.gradle +++ b/plugins/repository-hdfs/build.gradle @@ -70,17 +70,17 @@ dependencies { // Set the keytab files in the classpath so that we can access them from test code without the security manager // freaking out. if (isEclipse == false) { - testRuntime files(project(':test:fixtures:krb5kdc-fixture').ext.krb5Keytabs("hdfs","hdfs_hdfs.build.elastic.co.keytab").parent) + testRuntime files(project(':test:fixtures:krb5kdc-fixture').ext.krb5Keytabs("hdfs", "hdfs_hdfs.build.elastic.co.keytab").parent) } } normalization { - runtimeClasspath { - // ignore generated keytab files for the purposes of build avoidance - ignore '*.keytab' - // ignore fixture ports file which is on the classpath primarily to pacify the security manager - ignore '*HdfsFixture/**' - } + runtimeClasspath { + // ignore generated keytab files for the purposes of build avoidance + ignore '*.keytab' + // ignore fixture ports file which is on the classpath primarily to pacify the security manager + ignore '*HdfsFixture/**' + } } dependencyLicenses { @@ -95,7 +95,7 @@ for (String fixtureName : ['hdfsFixture', 'haHdfsFixture', 'secureHdfsFixture', project.tasks.create(fixtureName, org.elasticsearch.gradle.test.AntFixture) { dependsOn project.configurations.hdfsFixture, project(':test:fixtures:krb5kdc-fixture').tasks.postProcessFixture executable = "${BuildParams.runtimeJavaHome}/bin/java" - env 'CLASSPATH', "${ -> project.configurations.hdfsFixture.asPath }" + env 'CLASSPATH', "${-> project.configurations.hdfsFixture.asPath}" maxWaitInSeconds 60 onlyIf { project(':test:fixtures:krb5kdc-fixture').buildFixture.enabled && BuildParams.inFipsJvm == false } waitCondition = { fixture, ant -> @@ -127,7 +127,7 @@ for (String fixtureName : ['hdfsFixture', 'haHdfsFixture', 'secureHdfsFixture', if (fixtureName.equals('secureHdfsFixture') || fixtureName.equals('secureHaHdfsFixture')) { miniHDFSArgs.add("hdfs/hdfs.build.elastic.co@${realm}") miniHDFSArgs.add( - project(':test:fixtures:krb5kdc-fixture').ext.krb5Keytabs("hdfs", "hdfs_hdfs.build.elastic.co.keytab") + project(':test:fixtures:krb5kdc-fixture').ext.krb5Keytabs("hdfs", "hdfs_hdfs.build.elastic.co.keytab") ) } @@ -159,15 +159,15 @@ for (String integTestTaskName : ['integTestHa', 'integTestSecure', 'integTestSec if (integTestTaskName.contains("Ha")) { if (integTestTaskName.contains("Secure")) { Path path = buildDir.toPath() - .resolve("fixtures") - .resolve("secureHaHdfsFixture") - .resolve("ports") + .resolve("fixtures") + .resolve("secureHaHdfsFixture") + .resolve("ports") nonInputProperties.systemProperty "test.hdfs-fixture.ports", path } else { Path path = buildDir.toPath() - .resolve("fixtures") - .resolve("haHdfsFixture") - .resolve("ports") + .resolve("fixtures") + .resolve("haHdfsFixture") + .resolve("ports") nonInputProperties.systemProperty "test.hdfs-fixture.ports", path } classpath += files("$buildDir/fixtures") @@ -175,13 +175,13 @@ for (String integTestTaskName : ['integTestHa', 'integTestSecure', 'integTestSec if (integTestTaskName.contains("Secure")) { if (disabledIntegTestTaskNames.contains(integTestTaskName) == false) { - nonInputProperties.systemProperty "test.krb5.principal.es", "elasticsearch@${realm}" - nonInputProperties.systemProperty "test.krb5.principal.hdfs", "hdfs/hdfs.build.elastic.co@${realm}" - jvmArgs "-Djava.security.krb5.conf=${krb5conf}" - nonInputProperties.systemProperty ( - "test.krb5.keytab.hdfs", - project(':test:fixtures:krb5kdc-fixture').ext.krb5Keytabs("hdfs","hdfs_hdfs.build.elastic.co.keytab") - ) + nonInputProperties.systemProperty "test.krb5.principal.es", "elasticsearch@${realm}" + nonInputProperties.systemProperty "test.krb5.principal.hdfs", "hdfs/hdfs.build.elastic.co@${realm}" + jvmArgs "-Djava.security.krb5.conf=${krb5conf}" + nonInputProperties.systemProperty( + "test.krb5.keytab.hdfs", + project(':test:fixtures:krb5kdc-fixture').ext.krb5Keytabs("hdfs", "hdfs_hdfs.build.elastic.co.keytab") + ) } } } @@ -192,8 +192,8 @@ for (String integTestTaskName : ['integTestHa', 'integTestSecure', 'integTestSec if (integTestTaskName.contains("Secure")) { systemProperty "java.security.krb5.conf", krb5conf extraConfigFile( - "repository-hdfs/krb5.keytab", - file("${project(':test:fixtures:krb5kdc-fixture').ext.krb5Keytabs("hdfs", "elasticsearch.keytab")}"), IGNORE_VALUE + "repository-hdfs/krb5.keytab", + file("${project(':test:fixtures:krb5kdc-fixture').ext.krb5Keytabs("hdfs", "elasticsearch.keytab")}"), IGNORE_VALUE ) } } @@ -207,9 +207,9 @@ if (Os.isFamily(Os.FAMILY_WINDOWS)) { if (nativePath != null) { Path path = Paths.get(nativePath); if (Files.isDirectory(path) && - Files.exists(path.resolve("bin").resolve("winutils.exe")) && - Files.exists(path.resolve("bin").resolve("hadoop.dll")) && - Files.exists(path.resolve("bin").resolve("hdfs.dll"))) { + Files.exists(path.resolve("bin").resolve("winutils.exe")) && + Files.exists(path.resolve("bin").resolve("hadoop.dll")) && + Files.exists(path.resolve("bin").resolve("hdfs.dll"))) { fixtureSupported = true } else { throw new IllegalStateException("HADOOP_HOME: ${path} is invalid, does not contain hadoop native libraries in \$HADOOP_HOME/bin"); @@ -279,27 +279,27 @@ integTestSecureHa.runner { } thirdPartyAudit { - ignoreMissingClasses() - ignoreViolations ( - // internal java api: sun.net.dns.ResolverConfiguration - // internal java api: sun.net.util.IPAddressUtil - 'org.apache.hadoop.security.SecurityUtil$QualifiedHostResolver', + ignoreMissingClasses() + ignoreViolations( + // internal java api: sun.net.dns.ResolverConfiguration + // internal java api: sun.net.util.IPAddressUtil + 'org.apache.hadoop.security.SecurityUtil$QualifiedHostResolver', - // internal java api: sun.misc.Unsafe - 'com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator', - 'com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator$1', - 'org.apache.hadoop.io.FastByteComparisons$LexicographicalComparerHolder$UnsafeComparer', - 'org.apache.hadoop.io.FastByteComparisons$LexicographicalComparerHolder$UnsafeComparer$1', - 'org.apache.hadoop.io.nativeio.NativeIO', - 'org.apache.hadoop.hdfs.shortcircuit.ShortCircuitShm', - 'org.apache.hadoop.hdfs.shortcircuit.ShortCircuitShm$Slot', + // internal java api: sun.misc.Unsafe + 'com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator', + 'com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator$1', + 'org.apache.hadoop.io.FastByteComparisons$LexicographicalComparerHolder$UnsafeComparer', + 'org.apache.hadoop.io.FastByteComparisons$LexicographicalComparerHolder$UnsafeComparer$1', + 'org.apache.hadoop.io.nativeio.NativeIO', + 'org.apache.hadoop.hdfs.shortcircuit.ShortCircuitShm', + 'org.apache.hadoop.hdfs.shortcircuit.ShortCircuitShm$Slot', - // internal java api: sun.nio.ch.DirectBuffer - // internal java api: sun.misc.Cleaner - 'org.apache.hadoop.io.nativeio.NativeIO$POSIX', - 'org.apache.hadoop.crypto.CryptoStreamUtils', - - // internal java api: sun.misc.SignalHandler - 'org.apache.hadoop.util.SignalLogger$Handler', - ) + // internal java api: sun.nio.ch.DirectBuffer + // internal java api: sun.misc.Cleaner + 'org.apache.hadoop.io.nativeio.NativeIO$POSIX', + 'org.apache.hadoop.crypto.CryptoStreamUtils', + + // internal java api: sun.misc.SignalHandler + 'org.apache.hadoop.util.SignalLogger$Handler', + ) } diff --git a/plugins/repository-s3/build.gradle b/plugins/repository-s3/build.gradle index 125588b7019..d4f1c07fd48 100644 --- a/plugins/repository-s3/build.gradle +++ b/plugins/repository-s3/build.gradle @@ -167,7 +167,7 @@ if (useFixture) { thirdPartyTest { dependsOn tasks.bundlePlugin - nonInputProperties.systemProperty 'test.s3.endpoint', "${ -> minioAddress.call() }" + nonInputProperties.systemProperty 'test.s3.endpoint', "${-> minioAddress.call()}" } task integTestMinio(type: RestIntegTestTask) { @@ -176,9 +176,9 @@ if (useFixture) { runner { // Minio only supports a single access key, see https://github.com/minio/minio/pull/5968 systemProperty 'tests.rest.blacklist', [ - 'repository_s3/30_repository_temporary_credentials/*', - 'repository_s3/40_repository_ec2_credentials/*', - 'repository_s3/50_repository_ecs_credentials/*' + 'repository_s3/30_repository_temporary_credentials/*', + 'repository_s3/40_repository_ec2_credentials/*', + 'repository_s3/50_repository_ecs_credentials/*' ].join(",") } } @@ -197,11 +197,11 @@ if (useFixture) { } else { integTest.runner { systemProperty 'tests.rest.blacklist', - [ - 'repository_s3/30_repository_temporary_credentials/*', - 'repository_s3/40_repository_ec2_credentials/*', - 'repository_s3/50_repository_ecs_credentials/*' - ].join(",") + [ + 'repository_s3/30_repository_temporary_credentials/*', + 'repository_s3/40_repository_ec2_credentials/*', + 'repository_s3/50_repository_ecs_credentials/*' + ].join(",") } } @@ -213,15 +213,15 @@ File s3FixtureFile = new File(parentFixtures, 's3Fixture.properties') task s3FixtureProperties { outputs.file(s3FixtureFile) def s3FixtureOptions = [ - "tests.seed" : BuildParams.testSeed, - "s3Fixture.permanent_bucket_name" : s3PermanentBucket, - "s3Fixture.permanent_key" : s3PermanentAccessKey, - "s3Fixture.temporary_bucket_name" : s3TemporaryBucket, - "s3Fixture.temporary_key" : s3TemporaryAccessKey, - "s3Fixture.temporary_session_token": s3TemporarySessionToken, - "s3Fixture.ec2_bucket_name" : s3EC2Bucket, - "s3Fixture.ecs_bucket_name" : s3ECSBucket, - "s3Fixture.disableChunkedEncoding" : s3DisableChunkedEncoding + "tests.seed": BuildParams.testSeed, + "s3Fixture.permanent_bucket_name": s3PermanentBucket, + "s3Fixture.permanent_key": s3PermanentAccessKey, + "s3Fixture.temporary_bucket_name": s3TemporaryBucket, + "s3Fixture.temporary_key": s3TemporaryAccessKey, + "s3Fixture.temporary_session_token": s3TemporarySessionToken, + "s3Fixture.ec2_bucket_name": s3EC2Bucket, + "s3Fixture.ecs_bucket_name": s3ECSBucket, + "s3Fixture.disableChunkedEncoding": s3DisableChunkedEncoding ] doLast { @@ -235,22 +235,22 @@ task s3Fixture(type: AntFixture) { dependsOn s3FixtureProperties inputs.file(s3FixtureFile) - env 'CLASSPATH', "${ -> project.sourceSets.test.runtimeClasspath.asPath }" + env 'CLASSPATH', "${-> project.sourceSets.test.runtimeClasspath.asPath}" executable = "${BuildParams.runtimeJavaHome}/bin/java" args 'org.elasticsearch.repositories.s3.AmazonS3Fixture', baseDir, s3FixtureFile.getAbsolutePath() } processTestResources { Map expansions = [ - 'permanent_bucket': s3PermanentBucket, - 'permanent_base_path': s3PermanentBasePath + "_integration_tests", - 'temporary_bucket': s3TemporaryBucket, - 'temporary_base_path': s3TemporaryBasePath + "_integration_tests", - 'ec2_bucket': s3EC2Bucket, - 'ec2_base_path': s3EC2BasePath, - 'ecs_bucket': s3ECSBucket, - 'ecs_base_path': s3ECSBasePath, - 'disable_chunked_encoding': s3DisableChunkedEncoding, + 'permanent_bucket': s3PermanentBucket, + 'permanent_base_path': s3PermanentBasePath + "_integration_tests", + 'temporary_bucket': s3TemporaryBucket, + 'temporary_base_path': s3TemporaryBasePath + "_integration_tests", + 'ec2_bucket': s3EC2Bucket, + 'ec2_base_path': s3EC2BasePath, + 'ecs_bucket': s3ECSBucket, + 'ecs_base_path': s3ECSBasePath, + 'disable_chunked_encoding': s3DisableChunkedEncoding, ] inputs.properties(expansions) MavenFilteringHack.filter(it, expansions) @@ -290,10 +290,10 @@ if (useFixture) { dependsOn(project.s3Fixture) runner { systemProperty 'tests.rest.blacklist', [ - 'repository_s3/10_basic/*', - 'repository_s3/20_repository_permanent_credentials/*', - 'repository_s3/30_repository_temporary_credentials/*', - 'repository_s3/40_repository_ec2_credentials/*' + 'repository_s3/10_basic/*', + 'repository_s3/20_repository_permanent_credentials/*', + 'repository_s3/30_repository_temporary_credentials/*', + 'repository_s3/40_repository_ec2_credentials/*' ].join(",") } } @@ -313,12 +313,12 @@ if (useFixture) { } } -thirdPartyAudit.ignoreMissingClasses ( +thirdPartyAudit.ignoreMissingClasses( // classes are missing - 'javax.servlet.ServletContextEvent', - 'javax.servlet.ServletContextListener', - 'org.apache.avalon.framework.logger.Logger', - 'org.apache.log.Hierarchy', + 'javax.servlet.ServletContextEvent', + 'javax.servlet.ServletContextListener', + 'org.apache.avalon.framework.logger.Logger', + 'org.apache.log.Hierarchy', 'org.apache.log.Logger', 'software.amazon.ion.IonReader', 'software.amazon.ion.IonSystem', @@ -344,107 +344,107 @@ thirdPartyAudit.ignoreMissingClasses ( rootProject.globalInfo.ready { if (BuildParams.runtimeJavaVersion <= JavaVersion.VERSION_1_8) { thirdPartyAudit.ignoreJarHellWithJDK( - 'javax.xml.bind.Binder', - 'javax.xml.bind.ContextFinder$1', - 'javax.xml.bind.ContextFinder', - 'javax.xml.bind.DataBindingException', - 'javax.xml.bind.DatatypeConverter', - 'javax.xml.bind.DatatypeConverterImpl$CalendarFormatter', - 'javax.xml.bind.DatatypeConverterImpl', - 'javax.xml.bind.DatatypeConverterInterface', - 'javax.xml.bind.Element', - 'javax.xml.bind.GetPropertyAction', - 'javax.xml.bind.JAXB$Cache', - 'javax.xml.bind.JAXB', - 'javax.xml.bind.JAXBContext', - 'javax.xml.bind.JAXBElement$GlobalScope', - 'javax.xml.bind.JAXBElement', - 'javax.xml.bind.JAXBException', - 'javax.xml.bind.JAXBIntrospector', - 'javax.xml.bind.JAXBPermission', - 'javax.xml.bind.MarshalException', - 'javax.xml.bind.Marshaller$Listener', - 'javax.xml.bind.Marshaller', - 'javax.xml.bind.Messages', - 'javax.xml.bind.NotIdentifiableEvent', - 'javax.xml.bind.ParseConversionEvent', - 'javax.xml.bind.PrintConversionEvent', - 'javax.xml.bind.PropertyException', - 'javax.xml.bind.SchemaOutputResolver', - 'javax.xml.bind.TypeConstraintException', - 'javax.xml.bind.UnmarshalException', - 'javax.xml.bind.Unmarshaller$Listener', - 'javax.xml.bind.Unmarshaller', - 'javax.xml.bind.UnmarshallerHandler', - 'javax.xml.bind.ValidationEvent', - 'javax.xml.bind.ValidationEventHandler', - 'javax.xml.bind.ValidationEventLocator', - 'javax.xml.bind.ValidationException', - 'javax.xml.bind.Validator', - 'javax.xml.bind.WhiteSpaceProcessor', - 'javax.xml.bind.annotation.DomHandler', - 'javax.xml.bind.annotation.W3CDomHandler', - 'javax.xml.bind.annotation.XmlAccessOrder', - 'javax.xml.bind.annotation.XmlAccessType', - 'javax.xml.bind.annotation.XmlAccessorOrder', - 'javax.xml.bind.annotation.XmlAccessorType', - 'javax.xml.bind.annotation.XmlAnyAttribute', - 'javax.xml.bind.annotation.XmlAnyElement', - 'javax.xml.bind.annotation.XmlAttachmentRef', - 'javax.xml.bind.annotation.XmlAttribute', - 'javax.xml.bind.annotation.XmlElement$DEFAULT', - 'javax.xml.bind.annotation.XmlElement', - 'javax.xml.bind.annotation.XmlElementDecl$GLOBAL', - 'javax.xml.bind.annotation.XmlElementDecl', - 'javax.xml.bind.annotation.XmlElementRef$DEFAULT', - 'javax.xml.bind.annotation.XmlElementRef', - 'javax.xml.bind.annotation.XmlElementRefs', - 'javax.xml.bind.annotation.XmlElementWrapper', - 'javax.xml.bind.annotation.XmlElements', - 'javax.xml.bind.annotation.XmlEnum', - 'javax.xml.bind.annotation.XmlEnumValue', - 'javax.xml.bind.annotation.XmlID', - 'javax.xml.bind.annotation.XmlIDREF', - 'javax.xml.bind.annotation.XmlInlineBinaryData', - 'javax.xml.bind.annotation.XmlList', - 'javax.xml.bind.annotation.XmlMimeType', - 'javax.xml.bind.annotation.XmlMixed', - 'javax.xml.bind.annotation.XmlNs', - 'javax.xml.bind.annotation.XmlNsForm', - 'javax.xml.bind.annotation.XmlRegistry', - 'javax.xml.bind.annotation.XmlRootElement', - 'javax.xml.bind.annotation.XmlSchema', - 'javax.xml.bind.annotation.XmlSchemaType$DEFAULT', - 'javax.xml.bind.annotation.XmlSchemaType', - 'javax.xml.bind.annotation.XmlSchemaTypes', - 'javax.xml.bind.annotation.XmlSeeAlso', - 'javax.xml.bind.annotation.XmlTransient', - 'javax.xml.bind.annotation.XmlType$DEFAULT', - 'javax.xml.bind.annotation.XmlType', - 'javax.xml.bind.annotation.XmlValue', - 'javax.xml.bind.annotation.adapters.CollapsedStringAdapter', - 'javax.xml.bind.annotation.adapters.HexBinaryAdapter', - 'javax.xml.bind.annotation.adapters.NormalizedStringAdapter', - 'javax.xml.bind.annotation.adapters.XmlAdapter', - 'javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter$DEFAULT', - 'javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter', - 'javax.xml.bind.annotation.adapters.XmlJavaTypeAdapters', - 'javax.xml.bind.attachment.AttachmentMarshaller', - 'javax.xml.bind.attachment.AttachmentUnmarshaller', - 'javax.xml.bind.helpers.AbstractMarshallerImpl', - 'javax.xml.bind.helpers.AbstractUnmarshallerImpl', - 'javax.xml.bind.helpers.DefaultValidationEventHandler', - 'javax.xml.bind.helpers.Messages', - 'javax.xml.bind.helpers.NotIdentifiableEventImpl', - 'javax.xml.bind.helpers.ParseConversionEventImpl', - 'javax.xml.bind.helpers.PrintConversionEventImpl', - 'javax.xml.bind.helpers.ValidationEventImpl', - 'javax.xml.bind.helpers.ValidationEventLocatorImpl', - 'javax.xml.bind.util.JAXBResult', - 'javax.xml.bind.util.JAXBSource$1', - 'javax.xml.bind.util.JAXBSource', - 'javax.xml.bind.util.Messages', - 'javax.xml.bind.util.ValidationEventCollector' + 'javax.xml.bind.Binder', + 'javax.xml.bind.ContextFinder$1', + 'javax.xml.bind.ContextFinder', + 'javax.xml.bind.DataBindingException', + 'javax.xml.bind.DatatypeConverter', + 'javax.xml.bind.DatatypeConverterImpl$CalendarFormatter', + 'javax.xml.bind.DatatypeConverterImpl', + 'javax.xml.bind.DatatypeConverterInterface', + 'javax.xml.bind.Element', + 'javax.xml.bind.GetPropertyAction', + 'javax.xml.bind.JAXB$Cache', + 'javax.xml.bind.JAXB', + 'javax.xml.bind.JAXBContext', + 'javax.xml.bind.JAXBElement$GlobalScope', + 'javax.xml.bind.JAXBElement', + 'javax.xml.bind.JAXBException', + 'javax.xml.bind.JAXBIntrospector', + 'javax.xml.bind.JAXBPermission', + 'javax.xml.bind.MarshalException', + 'javax.xml.bind.Marshaller$Listener', + 'javax.xml.bind.Marshaller', + 'javax.xml.bind.Messages', + 'javax.xml.bind.NotIdentifiableEvent', + 'javax.xml.bind.ParseConversionEvent', + 'javax.xml.bind.PrintConversionEvent', + 'javax.xml.bind.PropertyException', + 'javax.xml.bind.SchemaOutputResolver', + 'javax.xml.bind.TypeConstraintException', + 'javax.xml.bind.UnmarshalException', + 'javax.xml.bind.Unmarshaller$Listener', + 'javax.xml.bind.Unmarshaller', + 'javax.xml.bind.UnmarshallerHandler', + 'javax.xml.bind.ValidationEvent', + 'javax.xml.bind.ValidationEventHandler', + 'javax.xml.bind.ValidationEventLocator', + 'javax.xml.bind.ValidationException', + 'javax.xml.bind.Validator', + 'javax.xml.bind.WhiteSpaceProcessor', + 'javax.xml.bind.annotation.DomHandler', + 'javax.xml.bind.annotation.W3CDomHandler', + 'javax.xml.bind.annotation.XmlAccessOrder', + 'javax.xml.bind.annotation.XmlAccessType', + 'javax.xml.bind.annotation.XmlAccessorOrder', + 'javax.xml.bind.annotation.XmlAccessorType', + 'javax.xml.bind.annotation.XmlAnyAttribute', + 'javax.xml.bind.annotation.XmlAnyElement', + 'javax.xml.bind.annotation.XmlAttachmentRef', + 'javax.xml.bind.annotation.XmlAttribute', + 'javax.xml.bind.annotation.XmlElement$DEFAULT', + 'javax.xml.bind.annotation.XmlElement', + 'javax.xml.bind.annotation.XmlElementDecl$GLOBAL', + 'javax.xml.bind.annotation.XmlElementDecl', + 'javax.xml.bind.annotation.XmlElementRef$DEFAULT', + 'javax.xml.bind.annotation.XmlElementRef', + 'javax.xml.bind.annotation.XmlElementRefs', + 'javax.xml.bind.annotation.XmlElementWrapper', + 'javax.xml.bind.annotation.XmlElements', + 'javax.xml.bind.annotation.XmlEnum', + 'javax.xml.bind.annotation.XmlEnumValue', + 'javax.xml.bind.annotation.XmlID', + 'javax.xml.bind.annotation.XmlIDREF', + 'javax.xml.bind.annotation.XmlInlineBinaryData', + 'javax.xml.bind.annotation.XmlList', + 'javax.xml.bind.annotation.XmlMimeType', + 'javax.xml.bind.annotation.XmlMixed', + 'javax.xml.bind.annotation.XmlNs', + 'javax.xml.bind.annotation.XmlNsForm', + 'javax.xml.bind.annotation.XmlRegistry', + 'javax.xml.bind.annotation.XmlRootElement', + 'javax.xml.bind.annotation.XmlSchema', + 'javax.xml.bind.annotation.XmlSchemaType$DEFAULT', + 'javax.xml.bind.annotation.XmlSchemaType', + 'javax.xml.bind.annotation.XmlSchemaTypes', + 'javax.xml.bind.annotation.XmlSeeAlso', + 'javax.xml.bind.annotation.XmlTransient', + 'javax.xml.bind.annotation.XmlType$DEFAULT', + 'javax.xml.bind.annotation.XmlType', + 'javax.xml.bind.annotation.XmlValue', + 'javax.xml.bind.annotation.adapters.CollapsedStringAdapter', + 'javax.xml.bind.annotation.adapters.HexBinaryAdapter', + 'javax.xml.bind.annotation.adapters.NormalizedStringAdapter', + 'javax.xml.bind.annotation.adapters.XmlAdapter', + 'javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter$DEFAULT', + 'javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter', + 'javax.xml.bind.annotation.adapters.XmlJavaTypeAdapters', + 'javax.xml.bind.attachment.AttachmentMarshaller', + 'javax.xml.bind.attachment.AttachmentUnmarshaller', + 'javax.xml.bind.helpers.AbstractMarshallerImpl', + 'javax.xml.bind.helpers.AbstractUnmarshallerImpl', + 'javax.xml.bind.helpers.DefaultValidationEventHandler', + 'javax.xml.bind.helpers.Messages', + 'javax.xml.bind.helpers.NotIdentifiableEventImpl', + 'javax.xml.bind.helpers.ParseConversionEventImpl', + 'javax.xml.bind.helpers.PrintConversionEventImpl', + 'javax.xml.bind.helpers.ValidationEventImpl', + 'javax.xml.bind.helpers.ValidationEventLocatorImpl', + 'javax.xml.bind.util.JAXBResult', + 'javax.xml.bind.util.JAXBSource$1', + 'javax.xml.bind.util.JAXBSource', + 'javax.xml.bind.util.Messages', + 'javax.xml.bind.util.ValidationEventCollector' ) } else { thirdPartyAudit.ignoreMissingClasses 'javax.activation.DataHandler' diff --git a/plugins/transport-nio/build.gradle b/plugins/transport-nio/build.gradle index 139047c8f09..e3e96d9ac46 100644 --- a/plugins/transport-nio/build.gradle +++ b/plugins/transport-nio/build.gradle @@ -21,146 +21,146 @@ import org.elasticsearch.gradle.info.BuildParams apply plugin: "nebula.maven-scm" esplugin { - description 'The nio transport.' - classname 'org.elasticsearch.transport.nio.NioTransportPlugin' - hasClientJar = true + description 'The nio transport.' + classname 'org.elasticsearch.transport.nio.NioTransportPlugin' + hasClientJar = true } dependencies { - compile project(':libs:elasticsearch-nio') + compile project(':libs:elasticsearch-nio') - // network stack - compile "io.netty:netty-buffer:${versions.netty}" - compile "io.netty:netty-codec:${versions.netty}" - compile "io.netty:netty-codec-http:${versions.netty}" - compile "io.netty:netty-common:${versions.netty}" - compile "io.netty:netty-handler:${versions.netty}" - compile "io.netty:netty-resolver:${versions.netty}" - compile "io.netty:netty-transport:${versions.netty}" + // network stack + compile "io.netty:netty-buffer:${versions.netty}" + compile "io.netty:netty-codec:${versions.netty}" + compile "io.netty:netty-codec-http:${versions.netty}" + compile "io.netty:netty-common:${versions.netty}" + compile "io.netty:netty-handler:${versions.netty}" + compile "io.netty:netty-resolver:${versions.netty}" + compile "io.netty:netty-transport:${versions.netty}" } dependencyLicenses { - mapping from: /netty-.*/, to: 'netty' + mapping from: /netty-.*/, to: 'netty' } thirdPartyAudit { - ignoreMissingClasses ( - // from io.netty.handler.codec.protobuf.ProtobufDecoder (netty) - 'com.google.protobuf.ExtensionRegistry', - 'com.google.protobuf.MessageLite$Builder', - 'com.google.protobuf.MessageLite', - 'com.google.protobuf.Parser', + ignoreMissingClasses( + // from io.netty.handler.codec.protobuf.ProtobufDecoder (netty) + 'com.google.protobuf.ExtensionRegistry', + 'com.google.protobuf.MessageLite$Builder', + 'com.google.protobuf.MessageLite', + 'com.google.protobuf.Parser', - // from io.netty.logging.CommonsLoggerFactory (netty) - 'org.apache.commons.logging.Log', - 'org.apache.commons.logging.LogFactory', + // from io.netty.logging.CommonsLoggerFactory (netty) + 'org.apache.commons.logging.Log', + 'org.apache.commons.logging.LogFactory', - // from Log4j (deliberate, Netty will fallback to Log4j 2) - 'org.apache.log4j.Level', - 'org.apache.log4j.Logger', + // from Log4j (deliberate, Netty will fallback to Log4j 2) + 'org.apache.log4j.Level', + 'org.apache.log4j.Logger', - // from io.netty.handler.ssl.util.BouncyCastleSelfSignedCertGenerator (netty) - 'org.bouncycastle.cert.X509v3CertificateBuilder', - 'org.bouncycastle.cert.jcajce.JcaX509CertificateConverter', - 'org.bouncycastle.cert.jcajce.JcaX509v3CertificateBuilder', - 'org.bouncycastle.jce.provider.BouncyCastleProvider', - 'org.bouncycastle.operator.jcajce.JcaContentSignerBuilder', + // from io.netty.handler.ssl.util.BouncyCastleSelfSignedCertGenerator (netty) + 'org.bouncycastle.cert.X509v3CertificateBuilder', + 'org.bouncycastle.cert.jcajce.JcaX509CertificateConverter', + 'org.bouncycastle.cert.jcajce.JcaX509v3CertificateBuilder', + 'org.bouncycastle.jce.provider.BouncyCastleProvider', + 'org.bouncycastle.operator.jcajce.JcaContentSignerBuilder', - // from io.netty.handler.ssl.JettyNpnSslEngine (netty) - 'org.eclipse.jetty.npn.NextProtoNego$ClientProvider', - 'org.eclipse.jetty.npn.NextProtoNego$ServerProvider', - 'org.eclipse.jetty.npn.NextProtoNego', + // from io.netty.handler.ssl.JettyNpnSslEngine (netty) + 'org.eclipse.jetty.npn.NextProtoNego$ClientProvider', + 'org.eclipse.jetty.npn.NextProtoNego$ServerProvider', + 'org.eclipse.jetty.npn.NextProtoNego', - // from io.netty.handler.codec.marshalling.ChannelBufferByteInput (netty) - 'org.jboss.marshalling.ByteInput', + // from io.netty.handler.codec.marshalling.ChannelBufferByteInput (netty) + 'org.jboss.marshalling.ByteInput', - // from io.netty.handler.codec.marshalling.ChannelBufferByteOutput (netty) - 'org.jboss.marshalling.ByteOutput', + // from io.netty.handler.codec.marshalling.ChannelBufferByteOutput (netty) + 'org.jboss.marshalling.ByteOutput', - // from io.netty.handler.codec.marshalling.CompatibleMarshallingEncoder (netty) - 'org.jboss.marshalling.Marshaller', + // from io.netty.handler.codec.marshalling.CompatibleMarshallingEncoder (netty) + 'org.jboss.marshalling.Marshaller', - // from io.netty.handler.codec.marshalling.ContextBoundUnmarshallerProvider (netty) - 'org.jboss.marshalling.MarshallerFactory', - 'org.jboss.marshalling.MarshallingConfiguration', - 'org.jboss.marshalling.Unmarshaller', + // from io.netty.handler.codec.marshalling.ContextBoundUnmarshallerProvider (netty) + 'org.jboss.marshalling.MarshallerFactory', + 'org.jboss.marshalling.MarshallingConfiguration', + 'org.jboss.marshalling.Unmarshaller', - // from io.netty.util.internal.logging.InternalLoggerFactory (netty) - it's optional - 'org.slf4j.helpers.FormattingTuple', - 'org.slf4j.helpers.MessageFormatter', - 'org.slf4j.Logger', - 'org.slf4j.LoggerFactory', - 'org.slf4j.spi.LocationAwareLogger', + // from io.netty.util.internal.logging.InternalLoggerFactory (netty) - it's optional + 'org.slf4j.helpers.FormattingTuple', + 'org.slf4j.helpers.MessageFormatter', + 'org.slf4j.Logger', + 'org.slf4j.LoggerFactory', + 'org.slf4j.spi.LocationAwareLogger', - 'com.google.protobuf.ExtensionRegistryLite', - 'com.google.protobuf.MessageLiteOrBuilder', - 'com.google.protobuf.nano.CodedOutputByteBufferNano', - 'com.google.protobuf.nano.MessageNano', - 'com.jcraft.jzlib.Deflater', - 'com.jcraft.jzlib.Inflater', - 'com.jcraft.jzlib.JZlib$WrapperType', - 'com.jcraft.jzlib.JZlib', - 'com.ning.compress.BufferRecycler', - 'com.ning.compress.lzf.ChunkDecoder', - 'com.ning.compress.lzf.ChunkEncoder', - 'com.ning.compress.lzf.LZFEncoder', - 'com.ning.compress.lzf.util.ChunkDecoderFactory', - 'com.ning.compress.lzf.util.ChunkEncoderFactory', - 'lzma.sdk.lzma.Encoder', - 'net.jpountz.lz4.LZ4Compressor', - 'net.jpountz.lz4.LZ4Factory', - 'net.jpountz.lz4.LZ4FastDecompressor', - 'net.jpountz.xxhash.XXHash32', - 'net.jpountz.xxhash.XXHashFactory', - 'org.eclipse.jetty.alpn.ALPN$ClientProvider', - 'org.eclipse.jetty.alpn.ALPN$ServerProvider', - 'org.eclipse.jetty.alpn.ALPN', + 'com.google.protobuf.ExtensionRegistryLite', + 'com.google.protobuf.MessageLiteOrBuilder', + 'com.google.protobuf.nano.CodedOutputByteBufferNano', + 'com.google.protobuf.nano.MessageNano', + 'com.jcraft.jzlib.Deflater', + 'com.jcraft.jzlib.Inflater', + 'com.jcraft.jzlib.JZlib$WrapperType', + 'com.jcraft.jzlib.JZlib', + 'com.ning.compress.BufferRecycler', + 'com.ning.compress.lzf.ChunkDecoder', + 'com.ning.compress.lzf.ChunkEncoder', + 'com.ning.compress.lzf.LZFEncoder', + 'com.ning.compress.lzf.util.ChunkDecoderFactory', + 'com.ning.compress.lzf.util.ChunkEncoderFactory', + 'lzma.sdk.lzma.Encoder', + 'net.jpountz.lz4.LZ4Compressor', + 'net.jpountz.lz4.LZ4Factory', + 'net.jpountz.lz4.LZ4FastDecompressor', + 'net.jpountz.xxhash.XXHash32', + 'net.jpountz.xxhash.XXHashFactory', + 'org.eclipse.jetty.alpn.ALPN$ClientProvider', + 'org.eclipse.jetty.alpn.ALPN$ServerProvider', + 'org.eclipse.jetty.alpn.ALPN', - 'org.conscrypt.AllocatedBuffer', - 'org.conscrypt.BufferAllocator', - 'org.conscrypt.Conscrypt', - 'org.conscrypt.HandshakeListener', + 'org.conscrypt.AllocatedBuffer', + 'org.conscrypt.BufferAllocator', + 'org.conscrypt.Conscrypt', + 'org.conscrypt.HandshakeListener', - // from io.netty.handler.ssl.OpenSslEngine (netty) - 'io.netty.internal.tcnative.Buffer', - 'io.netty.internal.tcnative.Library', - 'io.netty.internal.tcnative.SSL', - 'io.netty.internal.tcnative.SSLContext', - 'io.netty.internal.tcnative.SSLPrivateKeyMethod', - 'io.netty.internal.tcnative.CertificateCallback', - 'io.netty.internal.tcnative.CertificateVerifier', - 'io.netty.internal.tcnative.SessionTicketKey', - 'io.netty.internal.tcnative.SniHostNameMatcher', - ) + // from io.netty.handler.ssl.OpenSslEngine (netty) + 'io.netty.internal.tcnative.Buffer', + 'io.netty.internal.tcnative.Library', + 'io.netty.internal.tcnative.SSL', + 'io.netty.internal.tcnative.SSLContext', + 'io.netty.internal.tcnative.SSLPrivateKeyMethod', + 'io.netty.internal.tcnative.CertificateCallback', + 'io.netty.internal.tcnative.CertificateVerifier', + 'io.netty.internal.tcnative.SessionTicketKey', + 'io.netty.internal.tcnative.SniHostNameMatcher', + ) - ignoreViolations ( + ignoreViolations( - 'io.netty.util.internal.PlatformDependent0', - 'io.netty.util.internal.PlatformDependent0$1', - 'io.netty.util.internal.PlatformDependent0$2', - 'io.netty.util.internal.PlatformDependent0$3', - 'io.netty.util.internal.PlatformDependent0$5', - 'io.netty.util.internal.shaded.org.jctools.queues.BaseLinkedQueueConsumerNodeRef', - 'io.netty.util.internal.shaded.org.jctools.queues.BaseLinkedQueueProducerNodeRef', - 'io.netty.util.internal.shaded.org.jctools.queues.BaseMpscLinkedArrayQueueColdProducerFields', - 'io.netty.util.internal.shaded.org.jctools.queues.BaseMpscLinkedArrayQueueConsumerFields', - 'io.netty.util.internal.shaded.org.jctools.queues.BaseMpscLinkedArrayQueueProducerFields', - 'io.netty.util.internal.shaded.org.jctools.queues.LinkedQueueNode', - 'io.netty.util.internal.shaded.org.jctools.queues.MpscArrayQueueConsumerIndexField', - 'io.netty.util.internal.shaded.org.jctools.queues.MpscArrayQueueProducerIndexField', - 'io.netty.util.internal.shaded.org.jctools.queues.MpscArrayQueueProducerLimitField', - 'io.netty.util.internal.shaded.org.jctools.util.UnsafeAccess', - 'io.netty.util.internal.shaded.org.jctools.util.UnsafeRefArrayAccess', + 'io.netty.util.internal.PlatformDependent0', + 'io.netty.util.internal.PlatformDependent0$1', + 'io.netty.util.internal.PlatformDependent0$2', + 'io.netty.util.internal.PlatformDependent0$3', + 'io.netty.util.internal.PlatformDependent0$5', + 'io.netty.util.internal.shaded.org.jctools.queues.BaseLinkedQueueConsumerNodeRef', + 'io.netty.util.internal.shaded.org.jctools.queues.BaseLinkedQueueProducerNodeRef', + 'io.netty.util.internal.shaded.org.jctools.queues.BaseMpscLinkedArrayQueueColdProducerFields', + 'io.netty.util.internal.shaded.org.jctools.queues.BaseMpscLinkedArrayQueueConsumerFields', + 'io.netty.util.internal.shaded.org.jctools.queues.BaseMpscLinkedArrayQueueProducerFields', + 'io.netty.util.internal.shaded.org.jctools.queues.LinkedQueueNode', + 'io.netty.util.internal.shaded.org.jctools.queues.MpscArrayQueueConsumerIndexField', + 'io.netty.util.internal.shaded.org.jctools.queues.MpscArrayQueueProducerIndexField', + 'io.netty.util.internal.shaded.org.jctools.queues.MpscArrayQueueProducerLimitField', + 'io.netty.util.internal.shaded.org.jctools.util.UnsafeAccess', + 'io.netty.util.internal.shaded.org.jctools.util.UnsafeRefArrayAccess', - 'io.netty.handler.ssl.util.OpenJdkSelfSignedCertGenerator' - ) + 'io.netty.handler.ssl.util.OpenJdkSelfSignedCertGenerator' + ) } rootProject.globalInfo.ready { - if (BuildParams.inFipsJvm == false) { - // BouncyCastleFIPS provides this class, so the exclusion is invalid when running CI in - // a FIPS JVM with BouncyCastleFIPS Provider - thirdPartyAudit.ignoreMissingClasses( - 'org.bouncycastle.asn1.x500.X500Name' - ) - } + if (BuildParams.inFipsJvm == false) { + // BouncyCastleFIPS provides this class, so the exclusion is invalid when running CI in + // a FIPS JVM with BouncyCastleFIPS Provider + thirdPartyAudit.ignoreMissingClasses( + 'org.bouncycastle.asn1.x500.X500Name' + ) + } } diff --git a/qa/build.gradle b/qa/build.gradle index a4c8a0f37be..2fe2d102601 100644 --- a/qa/build.gradle +++ b/qa/build.gradle @@ -1,4 +1,3 @@ - import org.elasticsearch.gradle.test.RestIntegTestTask import org.elasticsearch.gradle.testclusters.TestClustersPlugin diff --git a/qa/ccs-unavailable-clusters/build.gradle b/qa/ccs-unavailable-clusters/build.gradle index 749623b26c3..0e04f87e99f 100644 --- a/qa/ccs-unavailable-clusters/build.gradle +++ b/qa/ccs-unavailable-clusters/build.gradle @@ -22,5 +22,5 @@ apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.test-with-dependencies' dependencies { - testCompile project(":client:rest-high-level") + testCompile project(":client:rest-high-level") } diff --git a/qa/die-with-dignity/build.gradle b/qa/die-with-dignity/build.gradle index a628c3742af..cef68780f9e 100644 --- a/qa/die-with-dignity/build.gradle +++ b/qa/die-with-dignity/build.gradle @@ -23,19 +23,19 @@ apply plugin: 'elasticsearch.testclusters' apply plugin: 'elasticsearch.esplugin' esplugin { - description 'Die with dignity plugin' - classname 'org.elasticsearch.DieWithDignityPlugin' + description 'Die with dignity plugin' + classname 'org.elasticsearch.DieWithDignityPlugin' } integTest.runner { - systemProperty 'tests.security.manager', 'false' - systemProperty 'tests.system_call_filter', 'false' - nonInputProperties.systemProperty 'log', "${-> testClusters.integTest.singleNode().getServerLog()}" - systemProperty 'runtime.java.home', BuildParams.runtimeJavaHome + systemProperty 'tests.security.manager', 'false' + systemProperty 'tests.system_call_filter', 'false' + nonInputProperties.systemProperty 'log', "${-> testClusters.integTest.singleNode().getServerLog()}" + systemProperty 'runtime.java.home', BuildParams.runtimeJavaHome } testClusters.integTest { - systemProperty "die.with.dignity.test", "whatever" + systemProperty "die.with.dignity.test", "whatever" } test.enabled = false diff --git a/qa/evil-tests/build.gradle b/qa/evil-tests/build.gradle index 38c1b3e1a9a..c79832f4e99 100644 --- a/qa/evil-tests/build.gradle +++ b/qa/evil-tests/build.gradle @@ -37,16 +37,16 @@ test { } thirdPartyAudit { - ignoreMissingClasses ( - 'com.ibm.icu.lang.UCharacter' - ) + ignoreMissingClasses( + 'com.ibm.icu.lang.UCharacter' + ) - ignoreViolations ( - // uses internal java api: sun.misc.Unsafe - 'com.google.common.cache.Striped64', - 'com.google.common.cache.Striped64$1', - 'com.google.common.cache.Striped64$Cell', - 'com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator', - 'com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator$1' - ) + ignoreViolations( + // uses internal java api: sun.misc.Unsafe + 'com.google.common.cache.Striped64', + 'com.google.common.cache.Striped64$1', + 'com.google.common.cache.Striped64$Cell', + 'com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator', + 'com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator$1' + ) } diff --git a/qa/full-cluster-restart/build.gradle b/qa/full-cluster-restart/build.gradle index 5409961e591..279bfa9ecff 100644 --- a/qa/full-cluster-restart/build.gradle +++ b/qa/full-cluster-restart/build.gradle @@ -36,7 +36,7 @@ for (Version bwcVersion : bwcVersions.indexCompatible) { testClusters { "${baseName}" { - versions = [ bwcVersion.toString(), project.version ] + versions = [bwcVersion.toString(), project.version] numberOfNodes = 2 // some tests rely on the translog not being flushed setting 'indices.memory.shard_inactive_time', '20m' @@ -68,15 +68,15 @@ for (Version bwcVersion : bwcVersions.indexCompatible) { tasks.matching { it.name.startsWith(baseName) && it.name.endsWith("ClusterTest") }.configureEach { it.systemProperty 'tests.old_cluster_version', bwcVersion.toString().minus("-SNAPSHOT") it.systemProperty 'tests.path.repo', "${buildDir}/cluster/shared/repo/${baseName}" - it.nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",") }") - it.nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName() }") + it.nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",")}") + it.nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName()}") } if (project.bwc_tests_enabled) { bwcTest.dependsOn( - tasks.register("${baseName}#bwcTest") { - dependsOn tasks.named("${baseName}#upgradedClusterTest") - } + tasks.register("${baseName}#bwcTest") { + dependsOn tasks.named("${baseName}#upgradedClusterTest") + } ) } } @@ -104,4 +104,4 @@ artifacts { testArtifacts testJar } -test.enabled = false \ No newline at end of file +test.enabled = false diff --git a/qa/logging-config/build.gradle b/qa/logging-config/build.gradle index 438079b9942..21bc9cebdff 100644 --- a/qa/logging-config/build.gradle +++ b/qa/logging-config/build.gradle @@ -1,40 +1,40 @@ - /* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch 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. - */ +/* +* Licensed to Elasticsearch under one or more contributor +* license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright +* ownership. Elasticsearch 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. +*/ apply plugin: 'elasticsearch.testclusters' apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.standalone-test' -testClusters.integTest { - /** - * Provide a custom log4j configuration where layout is an old style pattern and confirm that Elasticsearch - * can successfully startup. - */ - extraConfigFile 'log4j2.properties', file('custom-log4j2.properties') +testClusters.integTest { + /** + * Provide a custom log4j configuration where layout is an old style pattern and confirm that Elasticsearch + * can successfully startup. + */ + extraConfigFile 'log4j2.properties', file('custom-log4j2.properties') } integTest.runner { - nonInputProperties.systemProperty 'tests.logfile', - "${ -> testClusters.integTest.singleNode().getServerLog().absolutePath.replaceAll(".json", ".log")}" + nonInputProperties.systemProperty 'tests.logfile', + "${-> testClusters.integTest.singleNode().getServerLog().absolutePath.replaceAll(".json", ".log")}" } test { - systemProperty 'tests.security.manager', 'false' + systemProperty 'tests.security.manager', 'false' } diff --git a/qa/mixed-cluster/build.gradle b/qa/mixed-cluster/build.gradle index 5783e0e0399..5a439588327 100644 --- a/qa/mixed-cluster/build.gradle +++ b/qa/mixed-cluster/build.gradle @@ -39,14 +39,14 @@ dependencies { } processTestResources { - from ({ zipTree(configurations.restSpec.singleFile) }) + from({ zipTree(configurations.restSpec.singleFile) }) dependsOn configurations.restSpec } for (Version bwcVersion : bwcVersions.wireCompatible) { if (bwcVersion == VersionProperties.getElasticsearchVersion()) { // Not really a mixed cluster - continue ; + continue; } String baseName = "v${bwcVersion}" @@ -55,7 +55,7 @@ for (Version bwcVersion : bwcVersions.wireCompatible) { the nodes has a different minor. */ testClusters { "${baseName}" { - versions = [ bwcVersion.toString(), project.version ] + versions = [bwcVersion.toString(), project.version] numberOfNodes = 4 setting 'path.repo', "${buildDir}/cluster/shared/repo/${baseName}" @@ -69,16 +69,16 @@ for (Version bwcVersion : bwcVersions.wireCompatible) { doFirst { project.delete("${buildDir}/cluster/shared/repo/${baseName}") // Getting the endpoints causes a wait for the cluster - println "Test cluster endpoints are: ${-> testClusters."${baseName}".allHttpSocketURI.join(",") }" + println "Test cluster endpoints are: ${-> testClusters."${baseName}".allHttpSocketURI.join(",")}" println "Upgrading one node to create a mixed cluster" testClusters."${baseName}".nextNodeToNextVersion() // Getting the endpoints causes a wait for the cluster - println "Upgrade complete, endpoints are: ${-> testClusters."${baseName}".allHttpSocketURI.join(",") }" + println "Upgrade complete, endpoints are: ${-> testClusters."${baseName}".allHttpSocketURI.join(",")}" println "Upgrading another node to create a mixed cluster" testClusters."${baseName}".nextNodeToNextVersion() - nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",") }") - nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName() }") + nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",")}") + nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName()}") } systemProperty 'tests.path.repo', "${buildDir}/cluster/shared/repo/${baseName}" onlyIf { project.bwc_tests_enabled } diff --git a/qa/multi-cluster-search/build.gradle b/qa/multi-cluster-search/build.gradle index ddd626ca5fa..a0908e24b41 100644 --- a/qa/multi-cluster-search/build.gradle +++ b/qa/multi-cluster-search/build.gradle @@ -48,7 +48,7 @@ task mixedClusterTest(type: RestIntegTestTask) { testClusters.mixedClusterTest { setting 'cluster.remote.my_remote_cluster.seeds', - { "\"${testClusters.'remote-cluster'.getAllTransportPortURI().get(0)}\"" } + { "\"${testClusters.'remote-cluster'.getAllTransportPortURI().get(0)}\"" } setting 'cluster.remote.connections_per_cluster', '1' setting 'cluster.remote.connect', 'true' } diff --git a/qa/os/build.gradle b/qa/os/build.gradle index dbfb0d46be0..31d1bc85357 100644 --- a/qa/os/build.gradle +++ b/qa/os/build.gradle @@ -51,7 +51,7 @@ testingConventions.enabled = false tasks.dependencyLicenses.enabled = false tasks.dependenciesInfo.enabled = false -tasks.thirdPartyAudit.ignoreMissingClasses () +tasks.thirdPartyAudit.ignoreMissingClasses() tasks.register('destructivePackagingTest') { dependsOn 'destructiveDistroTest', 'destructiveBatsTest.oss', 'destructiveBatsTest.default' diff --git a/qa/rolling-upgrade/build.gradle b/qa/rolling-upgrade/build.gradle index 6e0672005e6..51a6ede1bd9 100644 --- a/qa/rolling-upgrade/build.gradle +++ b/qa/rolling-upgrade/build.gradle @@ -40,7 +40,7 @@ dependencies { } processTestResources { - from ({ zipTree(configurations.restSpec.singleFile) }) { + from({ zipTree(configurations.restSpec.singleFile) }) { include 'rest-api-spec/api/**' } dependsOn configurations.restSpec @@ -64,7 +64,7 @@ for (Version bwcVersion : bwcVersions.wireCompatible) { testClusters { "${baseName}" { - versions = [ bwcVersion.toString(), project.version ] + versions = [bwcVersion.toString(), project.version] numberOfNodes = 3 setting 'repositories.url.allowed_urls', 'http://snapshot.test*' @@ -82,8 +82,8 @@ for (Version bwcVersion : bwcVersions.wireCompatible) { project.delete("${buildDir}/cluster/shared/repo/${baseName}") } systemProperty 'tests.rest.suite', 'old_cluster' - nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",") }") - nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName() }") + nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",")}") + nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName()}") } tasks.register("${baseName}#oneThirdUpgradedTest", RestTestRunnerTask) { @@ -95,8 +95,8 @@ for (Version bwcVersion : bwcVersions.wireCompatible) { systemProperty 'tests.rest.suite', 'mixed_cluster' systemProperty 'tests.upgrade_from_version', project.version.replace("-SNAPSHOT", "") systemProperty 'tests.first_round', 'true' - nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",") }") - nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName() }") + nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",")}") + nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName()}") } tasks.register("${baseName}#twoThirdsUpgradedTest", RestTestRunnerTask) { @@ -108,8 +108,8 @@ for (Version bwcVersion : bwcVersions.wireCompatible) { systemProperty 'tests.rest.suite', 'mixed_cluster' systemProperty 'tests.upgrade_from_version', project.version.replace("-SNAPSHOT", "") systemProperty 'tests.first_round', 'false' - nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",") }") - nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName() }") + nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",")}") + nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName()}") } tasks.register("${baseName}#upgradedClusterTest", RestTestRunnerTask) { @@ -120,15 +120,15 @@ for (Version bwcVersion : bwcVersions.wireCompatible) { useCluster testClusters."${baseName}" systemProperty 'tests.rest.suite', 'upgraded_cluster' - nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",") }") - nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName() }") + nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",")}") + nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName()}") } if (project.bwc_tests_enabled) { bwcTest.dependsOn( - tasks.register("${baseName}#bwcTest") { - dependsOn tasks.named("${baseName}#upgradedClusterTest") - } + tasks.register("${baseName}#bwcTest") { + dependsOn tasks.named("${baseName}#upgradedClusterTest") + } ) } } diff --git a/qa/smoke-test-client/build.gradle b/qa/smoke-test-client/build.gradle index e1a65ce66c1..e5fc90b9915 100644 --- a/qa/smoke-test-client/build.gradle +++ b/qa/smoke-test-client/build.gradle @@ -25,29 +25,29 @@ apply plugin: 'elasticsearch.rest-test' // TODO: this test works, but it isn't really a rest test...should we have another plugin for "non rest test that just needs N clusters?" dependencies { - testCompile project(path: ':client:transport', configuration: 'runtime') // randomly swapped in as a transport + testCompile project(path: ':client:transport', configuration: 'runtime') // randomly swapped in as a transport } task singleNodeIntegTest(type: RestIntegTestTask) { - mustRunAfter(precommit) + mustRunAfter(precommit) } testClusters.singleNodeIntegTest { - setting 'discovery.type', 'single-node' + setting 'discovery.type', 'single-node' } integTest { - dependsOn singleNodeIntegTest + dependsOn singleNodeIntegTest } check.dependsOn(integTest) testingConventions { - naming.clear() - naming { - IT { - baseClass 'org.elasticsearch.smoketest.ESSmokeClientTestCase' - } + naming.clear() + naming { + IT { + baseClass 'org.elasticsearch.smoketest.ESSmokeClientTestCase' } + } } diff --git a/qa/smoke-test-http/build.gradle b/qa/smoke-test-http/build.gradle index 90fc9e39501..822c58e1bf4 100644 --- a/qa/smoke-test-http/build.gradle +++ b/qa/smoke-test-http/build.gradle @@ -23,14 +23,14 @@ apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.test-with-dependencies' dependencies { - testCompile project(path: ':modules:transport-netty4', configuration: 'runtime') // for http - testCompile project(path: ':plugins:transport-nio', configuration: 'runtime') // for http + testCompile project(path: ':modules:transport-netty4', configuration: 'runtime') // for http + testCompile project(path: ':plugins:transport-nio', configuration: 'runtime') // for http } integTest.runner { - /* - * We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each - * other if we allow them to set the number of available processors as it's set-once in Netty. - */ - systemProperty 'es.set.netty.runtime.available.processors', 'false' + /* + * We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each + * other if we allow them to set the number of available processors as it's set-once in Netty. + */ + systemProperty 'es.set.netty.runtime.available.processors', 'false' } diff --git a/qa/smoke-test-ingest-disabled/build.gradle b/qa/smoke-test-ingest-disabled/build.gradle index a0abc8b129d..7a818d542a7 100644 --- a/qa/smoke-test-ingest-disabled/build.gradle +++ b/qa/smoke-test-ingest-disabled/build.gradle @@ -22,9 +22,9 @@ apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' dependencies { - testCompile project(path: ':modules:ingest-common', configuration: 'runtime') + testCompile project(path: ':modules:ingest-common', configuration: 'runtime') } testClusters.integTest { - setting 'node.ingest', 'false' + setting 'node.ingest', 'false' } diff --git a/qa/smoke-test-ingest-with-all-dependencies/build.gradle b/qa/smoke-test-ingest-with-all-dependencies/build.gradle index 9f5c40ac937..214a8597e6e 100644 --- a/qa/smoke-test-ingest-with-all-dependencies/build.gradle +++ b/qa/smoke-test-ingest-with-all-dependencies/build.gradle @@ -22,17 +22,17 @@ apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' dependencies { - testCompile project(path: ':modules:ingest-common', configuration: 'runtime') - testCompile project(path: ':modules:ingest-geoip', configuration: 'runtime') - testCompile project(path: ':modules:lang-mustache', configuration: 'runtime') - testCompile project(path: ':modules:lang-painless', configuration: 'runtime') - testCompile project(path: ':modules:reindex', configuration: 'runtime') + testCompile project(path: ':modules:ingest-common', configuration: 'runtime') + testCompile project(path: ':modules:ingest-geoip', configuration: 'runtime') + testCompile project(path: ':modules:lang-mustache', configuration: 'runtime') + testCompile project(path: ':modules:lang-painless', configuration: 'runtime') + testCompile project(path: ':modules:reindex', configuration: 'runtime') } testingConventions { - naming { - IT { - baseClass 'org.elasticsearch.ingest.AbstractScriptTestCase' - } + naming { + IT { + baseClass 'org.elasticsearch.ingest.AbstractScriptTestCase' } + } } diff --git a/qa/smoke-test-multinode/build.gradle b/qa/smoke-test-multinode/build.gradle index 25964a871e0..b76a865c6f8 100644 --- a/qa/smoke-test-multinode/build.gradle +++ b/qa/smoke-test-multinode/build.gradle @@ -38,9 +38,9 @@ integTest.runner { } if ('default'.equalsIgnoreCase(System.getProperty('tests.distribution', 'oss'))) { systemProperty 'tests.rest.blacklist', [ - 'cat.templates/10_basic/No templates', - 'cat.templates/10_basic/Sort templates', - 'cat.templates/10_basic/Multiple template', - ].join(',') + 'cat.templates/10_basic/No templates', + 'cat.templates/10_basic/Sort templates', + 'cat.templates/10_basic/Multiple template', + ].join(',') } } diff --git a/qa/unconfigured-node-name/build.gradle b/qa/unconfigured-node-name/build.gradle index bcdc9ac958e..17d754cb19a 100644 --- a/qa/unconfigured-node-name/build.gradle +++ b/qa/unconfigured-node-name/build.gradle @@ -29,5 +29,5 @@ testClusters.integTest { integTest.runner { nonInputProperties.systemProperty 'tests.logfile', - "${ -> testClusters.integTest.singleNode().getServerLog() }" + "${-> testClusters.integTest.singleNode().getServerLog()}" } diff --git a/qa/verify-version-constants/build.gradle b/qa/verify-version-constants/build.gradle index 075e47922e2..356c1bda62e 100644 --- a/qa/verify-version-constants/build.gradle +++ b/qa/verify-version-constants/build.gradle @@ -26,38 +26,38 @@ apply plugin: 'elasticsearch.testclusters' apply plugin: 'elasticsearch.standalone-test' tasks.register("bwcTest") { - description = 'Runs backwards compatibility tests.' - group = 'verification' + description = 'Runs backwards compatibility tests.' + group = 'verification' } for (Version bwcVersion : bwcVersions.indexCompatible) { - String baseName = "v${bwcVersion}" + String baseName = "v${bwcVersion}" - testClusters { - "${baseName}" { - version = bwcVersion.toString() - setting 'http.content_type.required', 'true' - javaHome = BuildParams.runtimeJavaHome - } + testClusters { + "${baseName}" { + version = bwcVersion.toString() + setting 'http.content_type.required', 'true' + javaHome = BuildParams.runtimeJavaHome } + } - tasks.register("${baseName}#integTest", RestTestRunnerTask) { - useCluster testClusters."${baseName}" - nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",") }") - nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName() }") - } + tasks.register("${baseName}#integTest", RestTestRunnerTask) { + useCluster testClusters."${baseName}" + nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",")}") + nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName()}") + } - tasks.register("${baseName}#bwcTest") { - dependsOn "${baseName}#integTest" - } + tasks.register("${baseName}#bwcTest") { + dependsOn "${baseName}#integTest" + } - bwcTest.dependsOn("${baseName}#bwcTest") + bwcTest.dependsOn("${baseName}#bwcTest") } task bwcTestSnapshots { if (project.bwc_tests_enabled) { for (version in bwcVersions.unreleasedIndexCompatible) { - dependsOn "v${version}#bwcTest" + dependsOn "v${version}#bwcTest" } } } @@ -86,4 +86,4 @@ task verifyDocsLuceneVersion { check.dependsOn bwcTestSnapshots, verifyDocsLuceneVersion -test.enabled = false \ No newline at end of file +test.enabled = false diff --git a/qa/wildfly/build.gradle b/qa/wildfly/build.gradle index 5f1b50b2410..50d6502afb4 100644 --- a/qa/wildfly/build.gradle +++ b/qa/wildfly/build.gradle @@ -37,184 +37,184 @@ final String wildflyInstall = "${buildDir}/wildfly/wildfly-${wildflyVersion}" int managementPort repositories { - // the Wildfly distribution is not available via a repository, so we fake an Ivy repository on top of the download site - ivy { - name "wildfly" - url "https://download.jboss.org" - metadataSources { - artifact() - } - patternLayout { - artifact 'wildfly/[revision]/[module]-[revision].[ext]' - } + // the Wildfly distribution is not available via a repository, so we fake an Ivy repository on top of the download site + ivy { + name "wildfly" + url "https://download.jboss.org" + metadataSources { + artifact() } + patternLayout { + artifact 'wildfly/[revision]/[module]-[revision].[ext]' + } + } } configurations { - wildfly + wildfly } dependencies { - providedCompile 'javax.enterprise:cdi-api:1.2' - providedCompile 'org.jboss.spec.javax.annotation:jboss-annotations-api_1.2_spec:1.0.0.Final' - providedCompile 'org.jboss.spec.javax.ws.rs:jboss-jaxrs-api_2.0_spec:1.0.0.Final' - compile ('org.jboss.resteasy:resteasy-jackson2-provider:3.0.19.Final') { - exclude module: 'jackson-annotations' - exclude module: 'jackson-core' - exclude module: 'jackson-databind' - exclude module: 'jackson-jaxrs-json-provider' - } - compile "com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}" - compile "com.fasterxml.jackson.core:jackson-core:${versions.jackson}" - compile "com.fasterxml.jackson.core:jackson-databind:${versions.jackson}" - compile "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:${versions.jackson}" - compile "com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:${versions.jackson}" - compile "com.fasterxml.jackson.module:jackson-module-jaxb-annotations:${versions.jackson}" - compile "org.apache.logging.log4j:log4j-api:${versions.log4j}" - compile "org.apache.logging.log4j:log4j-core:${versions.log4j}" - compile project(path: ':client:transport', configuration: 'runtime') - wildfly "org.jboss:wildfly:${wildflyVersion}@zip" - testCompile project(':test:framework') + providedCompile 'javax.enterprise:cdi-api:1.2' + providedCompile 'org.jboss.spec.javax.annotation:jboss-annotations-api_1.2_spec:1.0.0.Final' + providedCompile 'org.jboss.spec.javax.ws.rs:jboss-jaxrs-api_2.0_spec:1.0.0.Final' + compile('org.jboss.resteasy:resteasy-jackson2-provider:3.0.19.Final') { + exclude module: 'jackson-annotations' + exclude module: 'jackson-core' + exclude module: 'jackson-databind' + exclude module: 'jackson-jaxrs-json-provider' + } + compile "com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}" + compile "com.fasterxml.jackson.core:jackson-core:${versions.jackson}" + compile "com.fasterxml.jackson.core:jackson-databind:${versions.jackson}" + compile "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:${versions.jackson}" + compile "com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:${versions.jackson}" + compile "com.fasterxml.jackson.module:jackson-module-jaxb-annotations:${versions.jackson}" + compile "org.apache.logging.log4j:log4j-api:${versions.log4j}" + compile "org.apache.logging.log4j:log4j-core:${versions.log4j}" + compile project(path: ':client:transport', configuration: 'runtime') + wildfly "org.jboss:wildfly:${wildflyVersion}@zip" + testCompile project(':test:framework') } task unzipWildfly(type: Sync) { - into wildflyDir - from { zipTree(configurations.wildfly.singleFile) } + into wildflyDir + from { zipTree(configurations.wildfly.singleFile) } } task deploy(type: Copy) { - dependsOn unzipWildfly, war - from war - into "${wildflyInstall}/standalone/deployments" + dependsOn unzipWildfly, war + from war + into "${wildflyInstall}/standalone/deployments" } task writeElasticsearchProperties(type: DefaultTestClustersTask) { - onlyIf { !Os.isFamily(Os.FAMILY_WINDOWS) } - useCluster testClusters.integTest - dependsOn deploy - doLast { - final File elasticsearchProperties = file("${wildflyInstall}/standalone/configuration/elasticsearch.properties") - elasticsearchProperties.write( - [ - "transport.uri=${-> testClusters.integTest.getAllTransportPortURI().get(0)}", - "cluster.name=integTest" - ].join("\n")) - } + onlyIf { !Os.isFamily(Os.FAMILY_WINDOWS) } + useCluster testClusters.integTest + dependsOn deploy + doLast { + final File elasticsearchProperties = file("${wildflyInstall}/standalone/configuration/elasticsearch.properties") + elasticsearchProperties.write( + [ + "transport.uri=${-> testClusters.integTest.getAllTransportPortURI().get(0)}", + "cluster.name=integTest" + ].join("\n")) + } } // the default configuration ships with IPv6 disabled but our cluster could be bound to IPv6 if the host supports it task enableIPv6 { - dependsOn unzipWildfly - doLast { - final File standaloneConf = file("${wildflyInstall}/bin/standalone.conf") - final List lines = - Files.readAllLines(standaloneConf.toPath()) - .collect { line -> line.replace("-Djava.net.preferIPv4Stack=true", "-Djava.net.preferIPv4Stack=false") } - standaloneConf.write(lines.join("\n")) - } + dependsOn unzipWildfly + doLast { + final File standaloneConf = file("${wildflyInstall}/bin/standalone.conf") + final List lines = + Files.readAllLines(standaloneConf.toPath()) + .collect { line -> line.replace("-Djava.net.preferIPv4Stack=true", "-Djava.net.preferIPv4Stack=false") } + standaloneConf.write(lines.join("\n")) + } } task startWildfly { - dependsOn enableIPv6, writeElasticsearchProperties - doLast { - // we skip these tests on Windows so we do no need to worry about compatibility here - final ProcessBuilder wildfly = new ProcessBuilder( - "${wildflyInstall}/bin/standalone.sh", - "-Djboss.http.port=0", - "-Djboss.https.port=0", - "-Djboss.management.http.port=0") - final Process process = wildfly.start() - new BufferedReader(new InputStreamReader(process.getInputStream())).withReader { br -> - String line - int httpPort = 0 - while ((line = br.readLine()) != null) { - logger.info(line) - if (line.matches('.*Undertow HTTP listener default listening on .*:\\d+$')) { - assert httpPort == 0 - final int index = line.lastIndexOf(":") - assert index >= 0 - httpPort = Integer.parseInt(line.substring(index + 1)) - // set this system property so the test runner knows the port Wildfly is listening for HTTP requests on - integTestRunner.systemProperty("tests.jboss.root", "http://localhost:$httpPort/wildfly-$version/transport") - } else if (line.matches('.*Http management interface listening on http://.*:\\d+/management$')) { - assert managementPort == 0 - final int colonIndex = line.lastIndexOf(":") - assert colonIndex >= 0 - final int slashIndex = line.lastIndexOf("/") - assert slashIndex >= 0 - managementPort = Integer.parseInt(line.substring(colonIndex + 1, slashIndex)) + dependsOn enableIPv6, writeElasticsearchProperties + doLast { + // we skip these tests on Windows so we do no need to worry about compatibility here + final ProcessBuilder wildfly = new ProcessBuilder( + "${wildflyInstall}/bin/standalone.sh", + "-Djboss.http.port=0", + "-Djboss.https.port=0", + "-Djboss.management.http.port=0") + final Process process = wildfly.start() + new BufferedReader(new InputStreamReader(process.getInputStream())).withReader { br -> + String line + int httpPort = 0 + while ((line = br.readLine()) != null) { + logger.info(line) + if (line.matches('.*Undertow HTTP listener default listening on .*:\\d+$')) { + assert httpPort == 0 + final int index = line.lastIndexOf(":") + assert index >= 0 + httpPort = Integer.parseInt(line.substring(index + 1)) + // set this system property so the test runner knows the port Wildfly is listening for HTTP requests on + integTestRunner.systemProperty("tests.jboss.root", "http://localhost:$httpPort/wildfly-$version/transport") + } else if (line.matches('.*Http management interface listening on http://.*:\\d+/management$')) { + assert managementPort == 0 + final int colonIndex = line.lastIndexOf(":") + assert colonIndex >= 0 + final int slashIndex = line.lastIndexOf("/") + assert slashIndex >= 0 + managementPort = Integer.parseInt(line.substring(colonIndex + 1, slashIndex)) - /* - * As soon as we know the management port, we fork a process that will ensure the Wildfly process is killed if we - * teardown abnormally. We skip these tests on Windows so we do not need to worry about CLI compatibility here. - */ - final File script = new File(project.buildDir, "wildfly/wildfly.killer.sh") - script.setText( - ["function shutdown {", - " ${wildflyInstall}/bin/jboss-cli.sh --controller=localhost:${-> managementPort} --connect command=shutdown", - "}", - "trap shutdown EXIT", - // will wait indefinitely for input, but we never pass input, and the pipe is only closed when the build dies - "read line\n"].join('\n'), 'UTF-8') - final ProcessBuilder killer = new ProcessBuilder("bash", script.absolutePath) - killer.start() + /* + * As soon as we know the management port, we fork a process that will ensure the Wildfly process is killed if we + * teardown abnormally. We skip these tests on Windows so we do not need to worry about CLI compatibility here. + */ + final File script = new File(project.buildDir, "wildfly/wildfly.killer.sh") + script.setText( + ["function shutdown {", + " ${wildflyInstall}/bin/jboss-cli.sh --controller=localhost:${-> managementPort} --connect command=shutdown", + "}", + "trap shutdown EXIT", + // will wait indefinitely for input, but we never pass input, and the pipe is only closed when the build dies + "read line\n"].join('\n'), 'UTF-8') + final ProcessBuilder killer = new ProcessBuilder("bash", script.absolutePath) + killer.start() - } else if (line.matches(".*WildFly Full \\d+\\.\\d+\\.\\d+\\.Final \\(WildFly Core \\d+\\.\\d+\\.\\d+\\.Final\\) started.*")) { - break - } - } - - assert httpPort > 0 - assert managementPort > 0 + } else if (line.matches(".*WildFly Full \\d+\\.\\d+\\.\\d+\\.Final \\(WildFly Core \\d+\\.\\d+\\.\\d+\\.Final\\) started.*")) { + break } + } + + assert httpPort > 0 + assert managementPort > 0 } + } } task configureTransportClient(type: LoggedExec) { - dependsOn startWildfly - // we skip these tests on Windows so we do not need to worry about compatibility here - commandLine "${wildflyInstall}/bin/jboss-cli.sh", - "--controller=localhost:${-> managementPort}", - "--connect", - "--command=/system-property=elasticsearch.properties:add(value=\${jboss.server.config.dir}/elasticsearch.properties)" + dependsOn startWildfly + // we skip these tests on Windows so we do not need to worry about compatibility here + commandLine "${wildflyInstall}/bin/jboss-cli.sh", + "--controller=localhost:${-> managementPort}", + "--connect", + "--command=/system-property=elasticsearch.properties:add(value=\${jboss.server.config.dir}/elasticsearch.properties)" } task stopWildfly(type: LoggedExec) { - // we skip these tests on Windows so we do not need to worry about CLI compatibility here - commandLine "${wildflyInstall}/bin/jboss-cli.sh", "--controller=localhost:${-> managementPort}", "--connect", "command=shutdown" + // we skip these tests on Windows so we do not need to worry about CLI compatibility here + commandLine "${wildflyInstall}/bin/jboss-cli.sh", "--controller=localhost:${-> managementPort}", "--connect", "command=shutdown" } if (!Os.isFamily(Os.FAMILY_WINDOWS)) { - integTestRunner.dependsOn(configureTransportClient) - final TaskExecutionAdapter logDumpListener = new TaskExecutionAdapter() { - @Override - void afterExecute(final Task task, final TaskState state) { - if (state.failure != null) { - final File logFile = new File(wildflyInstall, "standalone/log/server.log") - println("\nWildfly server log (from ${logFile}):") - println('-----------------------------------------') - final Stream stream = Files.lines(logFile.toPath(), StandardCharsets.UTF_8) - try { - for (String line : stream) { - println(line) - } - } finally { - stream.close() - } - println('=========================================') - } + integTestRunner.dependsOn(configureTransportClient) + final TaskExecutionAdapter logDumpListener = new TaskExecutionAdapter() { + @Override + void afterExecute(final Task task, final TaskState state) { + if (state.failure != null) { + final File logFile = new File(wildflyInstall, "standalone/log/server.log") + println("\nWildfly server log (from ${logFile}):") + println('-----------------------------------------') + final Stream stream = Files.lines(logFile.toPath(), StandardCharsets.UTF_8) + try { + for (String line : stream) { + println(line) + } + } finally { + stream.close() } + println('=========================================') + } } - integTestRunner.doFirst { - project.gradle.addListener(logDumpListener) - } - integTestRunner.doLast { - project.gradle.removeListener(logDumpListener) - } - integTestRunner.finalizedBy(stopWildfly) + } + integTestRunner.doFirst { + project.gradle.addListener(logDumpListener) + } + integTestRunner.doLast { + project.gradle.removeListener(logDumpListener) + } + integTestRunner.finalizedBy(stopWildfly) } else { - integTest.enabled = false - testingConventions.enabled = false + integTest.enabled = false + testingConventions.enabled = false } check.dependsOn(integTest) @@ -228,11 +228,11 @@ thirdPartyAudit.enabled = false testingConventions { - naming.clear() - // We only have one "special" integration test here to connect to wildfly - naming { - IT { - baseClass 'org.apache.lucene.util.LuceneTestCase' - } + naming.clear() + // We only have one "special" integration test here to connect to wildfly + naming { + IT { + baseClass 'org.apache.lucene.util.LuceneTestCase' } + } } diff --git a/server/build.gradle b/server/build.gradle index ef7db8ec5a5..6e9dcdbd34e 100644 --- a/server/build.gradle +++ b/server/build.gradle @@ -43,11 +43,11 @@ if (!isEclipse && !isIdea) { } } } - + configurations { java9Compile.extendsFrom(compile) } - + dependencies { java9Compile sourceSets.main.output } @@ -208,7 +208,7 @@ processResources { dependsOn generateModulesList, generatePluginsList } -thirdPartyAudit.ignoreMissingClasses ( +thirdPartyAudit.ignoreMissingClasses( // from com.fasterxml.jackson.dataformat.yaml.YAMLMapper (jackson-dataformat-yaml) 'com.fasterxml.jackson.databind.ObjectMapper', @@ -328,9 +328,9 @@ dependencyLicenses { mapping from: /lucene-.*/, to: 'lucene' dependencies = project.configurations.runtime.fileCollection { it.group.startsWith('org.elasticsearch') == false || - // keep the following org.elasticsearch jars in - (it.name == 'jna' || - it.name == 'securesm') + // keep the following org.elasticsearch jars in + (it.name == 'jna' || + it.name == 'securesm') } } @@ -339,13 +339,13 @@ task integTest(type: Test) { description = 'Multi-node tests' mustRunAfter test - include '**/*IT.class' + include '**/*IT.class' } check.dependsOn integTest task internalClusterTest { - dependsOn integTest + dependsOn integTest } diff --git a/settings.gradle b/settings.gradle index 0ca039e251e..109ae6db67a 100644 --- a/settings.gradle +++ b/settings.gradle @@ -62,11 +62,11 @@ List projects = [ ] /** - * Iterates over sub directories, looking for build.gradle, and adds a project if found - * for that dir with the given path prefix. Note that this requires each level - * of the dir hierarchy to have a build.gradle. Otherwise we would have to iterate - * all files/directories in the source tree to find all projects. - */ + * Iterates over sub directories, looking for build.gradle, and adds a project if found + * for that dir with the given path prefix. Note that this requires each level + * of the dir hierarchy to have a build.gradle. Otherwise we would have to iterate + * all files/directories in the source tree to find all projects. + */ void addSubProjects(String path, File dir) { if (dir.isDirectory() == false) return; if (dir.name == 'buildSrc') return; @@ -76,12 +76,12 @@ void addSubProjects(String path, File dir) { final String projectName = "${path}:${dir.name}" include projectName if (path.isEmpty() || path.startsWith(':example-plugins')) { - project(projectName).projectDir = dir - } - for (File subdir : dir.listFiles()) { - addSubProjects(projectName, subdir) - } + project(projectName).projectDir = dir } + for (File subdir : dir.listFiles()) { + addSubProjects(projectName, subdir) + } +} // include example plugins first, so adding plugin dirs below won't muck with :example-plugins @@ -107,7 +107,7 @@ project(':build-tools').projectDir = new File(rootProject.projectDir, 'buildSrc' project(':build-tools:reaper').projectDir = new File(rootProject.projectDir, 'buildSrc/reaper') project(":libs").children.each { libsProject -> - libsProject.name = "elasticsearch-${libsProject.name}" + libsProject.name = "elasticsearch-${libsProject.name}" } // look for extra plugins for elasticsearch diff --git a/test/fixtures/azure-fixture/build.gradle b/test/fixtures/azure-fixture/build.gradle index cc65d3c05e2..a01954ba289 100644 --- a/test/fixtures/azure-fixture/build.gradle +++ b/test/fixtures/azure-fixture/build.gradle @@ -23,17 +23,17 @@ description = 'Fixture for Azure external service' test.enabled = false dependencies { - compile project(':server') + compile project(':server') } preProcessFixture { - dependsOn jar - doLast { - file("${testFixturesDir}/shared").mkdirs() - project.copy { - from jar - from configurations.runtimeClasspath - into "${testFixturesDir}/shared" - } + dependsOn jar + doLast { + file("${testFixturesDir}/shared").mkdirs() + project.copy { + from jar + from configurations.runtimeClasspath + into "${testFixturesDir}/shared" } -} \ No newline at end of file + } +} diff --git a/test/fixtures/build.gradle b/test/fixtures/build.gradle index 153124e84b0..221008cd4e4 100644 --- a/test/fixtures/build.gradle +++ b/test/fixtures/build.gradle @@ -1,4 +1,3 @@ - subprojects { // fixtures are mostly external and by default we don't want to check forbidden apis forbiddenApisMain.enabled = false diff --git a/test/fixtures/gcs-fixture/build.gradle b/test/fixtures/gcs-fixture/build.gradle index 9673d54f900..35eaf4c3a2f 100644 --- a/test/fixtures/gcs-fixture/build.gradle +++ b/test/fixtures/gcs-fixture/build.gradle @@ -23,17 +23,17 @@ description = 'Fixture for Google Cloud Storage service' test.enabled = false dependencies { - compile project(':server') + compile project(':server') } preProcessFixture { - dependsOn jar - doLast { - file("${testFixturesDir}/shared").mkdirs() - project.copy { - from jar - from configurations.runtimeClasspath - into "${testFixturesDir}/shared" - } + dependsOn jar + doLast { + file("${testFixturesDir}/shared").mkdirs() + project.copy { + from jar + from configurations.runtimeClasspath + into "${testFixturesDir}/shared" } -} \ No newline at end of file + } +} diff --git a/test/fixtures/krb5kdc-fixture/build.gradle b/test/fixtures/krb5kdc-fixture/build.gradle index 0b9a40eca7f..2879894a611 100644 --- a/test/fixtures/krb5kdc-fixture/build.gradle +++ b/test/fixtures/krb5kdc-fixture/build.gradle @@ -21,7 +21,7 @@ apply plugin: 'elasticsearch.test.fixtures' // installKDC uses tabs in it for the Kerberos ACL file. // Ignore it for pattern checking. forbiddenPatterns { - exclude "**/installkdc.sh" + exclude "**/installkdc.sh" } List services = ["peppa", "hdfs"] @@ -33,18 +33,18 @@ preProcessFixture.doLast { } postProcessFixture { - inputs.dir("${testFixturesDir}/shared") - services.each { service -> - File confTemplate = file("${testFixturesDir}/shared/${service}/krb5.conf.template") - File confFile = file("${testFixturesDir}/shared/${service}/krb5.conf") - outputs.file(confFile) - doLast { - assert confTemplate.exists() - String confContents = confTemplate.text - .replace("\${MAPPED_PORT}", "${ext."test.fixtures.${service}.udp.88"}") - confFile.text = confContents - } + inputs.dir("${testFixturesDir}/shared") + services.each { service -> + File confTemplate = file("${testFixturesDir}/shared/${service}/krb5.conf.template") + File confFile = file("${testFixturesDir}/shared/${service}/krb5.conf") + outputs.file(confFile) + doLast { + assert confTemplate.exists() + String confContents = confTemplate.text + .replace("\${MAPPED_PORT}", "${ext."test.fixtures.${service}.udp.88"}") + confFile.text = confContents } + } } project.ext.krb5Conf = { service -> file("$testFixturesDir/shared/${service}/krb5.conf") } diff --git a/test/framework/build.gradle b/test/framework/build.gradle index 6427308347f..35978bb4ddd 100644 --- a/test/framework/build.gradle +++ b/test/framework/build.gradle @@ -46,7 +46,7 @@ forbiddenApisMain { dependencyLicenses.enabled = false dependenciesInfo.enabled = false -thirdPartyAudit.ignoreMissingClasses ( +thirdPartyAudit.ignoreMissingClasses( // classes are missing 'javax.servlet.ServletContextEvent', 'javax.servlet.ServletContextListener', @@ -70,5 +70,5 @@ task integTest(type: Test) { } tasks.register("verifyVersions") { - dependsOn test + dependsOn test } diff --git a/test/logger-usage/build.gradle b/test/logger-usage/build.gradle index 0fa2ee3bfd9..34bddf82eb5 100644 --- a/test/logger-usage/build.gradle +++ b/test/logger-usage/build.gradle @@ -31,7 +31,7 @@ forbiddenApisMain { } jarHell.enabled = true // disabled by parent project -thirdPartyAudit.ignoreMissingClasses ( +thirdPartyAudit.ignoreMissingClasses( // log4j 'org.osgi.framework.AdaptPermission', 'org.osgi.framework.AdminPermission', diff --git a/x-pack/build.gradle b/x-pack/build.gradle index f9b13f07618..5ff129dee98 100644 --- a/x-pack/build.gradle +++ b/x-pack/build.gradle @@ -14,10 +14,10 @@ subprojects { project.esplugin.licenseFile = rootProject.file('licenses/ELASTIC-LICENSE.txt') project.esplugin.noticeFile = xpackRootProject.file('NOTICE.txt') } - + tasks.withType(LicenseHeadersTask.class) { - approvedLicenses = ['Elastic License', 'Generated'] - additionalLicense 'ELAST', 'Elastic License', 'Licensed under the Elastic License' + approvedLicenses = ['Elastic License', 'Generated'] + additionalLicense 'ELAST', 'Elastic License', 'Licensed under the Elastic License' } ext.licenseName = 'Elastic License' diff --git a/x-pack/docs/build.gradle b/x-pack/docs/build.gradle index 55f51d267c6..283f4035081 100644 --- a/x-pack/docs/build.gradle +++ b/x-pack/docs/build.gradle @@ -7,18 +7,18 @@ apply plugin: 'elasticsearch.docs-test' * only remove entries from this list. When it is empty we'll remove it * entirely and have a party! There will be cake and everything.... */ buildRestTests.expectedUnconvertedCandidates = [ - 'en/rest-api/watcher/put-watch.asciidoc', - 'en/security/authentication/user-cache.asciidoc', - 'en/security/authorization/run-as-privilege.asciidoc', - 'en/security/ccs-clients-integrations/http.asciidoc', - 'en/rest-api/watcher/stats.asciidoc', - 'en/watcher/example-watches/watching-time-series-data.asciidoc', + 'en/rest-api/watcher/put-watch.asciidoc', + 'en/security/authentication/user-cache.asciidoc', + 'en/security/authorization/run-as-privilege.asciidoc', + 'en/security/ccs-clients-integrations/http.asciidoc', + 'en/rest-api/watcher/stats.asciidoc', + 'en/watcher/example-watches/watching-time-series-data.asciidoc', ] dependencies { - testCompile project(path: xpackModule('core'), configuration: 'default') - testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') - testCompile project(path: xpackProject('plugin').path, configuration: 'testArtifacts') + testCompile project(path: xpackModule('core'), configuration: 'default') + testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') + testCompile project(path: xpackProject('plugin').path, configuration: 'testArtifacts') } // copy xpack rest api @@ -28,50 +28,50 @@ project.copyRestSpec.from(xpackResources) { } testClusters.integTest { - extraConfigFile 'op-jwks.json', xpackProject('test:idp-fixture').file("oidc/op-jwks.json") - extraConfigFile 'idp-docs-metadata.xml', xpackProject('test:idp-fixture').file("idp/shibboleth-idp/metadata/idp-docs-metadata.xml") - extraConfigFile 'testClient.crt', xpackProject('plugin:security').file("src/test/resources/org/elasticsearch/xpack/security/action/pki_delegation/testClient.crt") - setting 'xpack.security.enabled', 'true' - setting 'xpack.security.authc.api_key.enabled', 'true' - setting 'xpack.security.authc.token.enabled', 'true' - // Disable monitoring exporters for the docs tests - setting 'xpack.monitoring.exporters._local.type', 'local' - setting 'xpack.monitoring.exporters._local.enabled', 'false' - setting 'xpack.license.self_generated.type', 'trial' - setting 'xpack.security.authc.realms.file.file.order', '0' - setting 'xpack.security.authc.realms.native.native.order', '1' - setting 'xpack.security.authc.realms.oidc.oidc1.order', '2' - setting 'xpack.security.authc.realms.oidc.oidc1.op.issuer', 'http://127.0.0.1:8080' - setting 'xpack.security.authc.realms.oidc.oidc1.op.authorization_endpoint', "http://127.0.0.1:8080/c2id-login" - setting 'xpack.security.authc.realms.oidc.oidc1.op.token_endpoint', "http://127.0.0.1:8080/c2id/token" - setting 'xpack.security.authc.realms.oidc.oidc1.op.jwkset_path', 'op-jwks.json' - setting 'xpack.security.authc.realms.oidc.oidc1.rp.redirect_uri', 'https://my.fantastic.rp/cb' - setting 'xpack.security.authc.realms.oidc.oidc1.rp.client_id', 'elasticsearch-rp' - keystore 'xpack.security.authc.realms.oidc.oidc1.rp.client_secret', 'b07efb7a1cf6ec9462afe7b6d3ab55c6c7880262aa61ac28dded292aca47c9a2' - setting 'xpack.security.authc.realms.oidc.oidc1.rp.response_type', 'id_token' - setting 'xpack.security.authc.realms.oidc.oidc1.claims.principal', 'sub' - setting 'xpack.security.authc.realms.pki.pki1.order', '3' - setting 'xpack.security.authc.realms.pki.pki1.certificate_authorities', '[ "testClient.crt" ]' - setting 'xpack.security.authc.realms.pki.pki1.delegation.enabled', 'true' - setting 'xpack.security.authc.realms.saml.saml1.order', '4' - setting 'xpack.security.authc.realms.saml.saml1.idp.entity_id', 'https://my-idp.org' - setting 'xpack.security.authc.realms.saml.saml1.idp.metadata.path', 'idp-docs-metadata.xml' - setting 'xpack.security.authc.realms.saml.saml1.sp.entity_id', 'https://kibana.org' - setting 'xpack.security.authc.realms.saml.saml1.sp.acs', 'https://kibana.org/api/security/v1/saml' - setting 'xpack.security.authc.realms.saml.saml1.attributes.principal', 'uid' - setting 'xpack.security.authc.realms.saml.saml1.attributes.name', 'urn:oid:2.5.4.3' - user username: 'test_admin' + extraConfigFile 'op-jwks.json', xpackProject('test:idp-fixture').file("oidc/op-jwks.json") + extraConfigFile 'idp-docs-metadata.xml', xpackProject('test:idp-fixture').file("idp/shibboleth-idp/metadata/idp-docs-metadata.xml") + extraConfigFile 'testClient.crt', xpackProject('plugin:security').file("src/test/resources/org/elasticsearch/xpack/security/action/pki_delegation/testClient.crt") + setting 'xpack.security.enabled', 'true' + setting 'xpack.security.authc.api_key.enabled', 'true' + setting 'xpack.security.authc.token.enabled', 'true' + // Disable monitoring exporters for the docs tests + setting 'xpack.monitoring.exporters._local.type', 'local' + setting 'xpack.monitoring.exporters._local.enabled', 'false' + setting 'xpack.license.self_generated.type', 'trial' + setting 'xpack.security.authc.realms.file.file.order', '0' + setting 'xpack.security.authc.realms.native.native.order', '1' + setting 'xpack.security.authc.realms.oidc.oidc1.order', '2' + setting 'xpack.security.authc.realms.oidc.oidc1.op.issuer', 'http://127.0.0.1:8080' + setting 'xpack.security.authc.realms.oidc.oidc1.op.authorization_endpoint', "http://127.0.0.1:8080/c2id-login" + setting 'xpack.security.authc.realms.oidc.oidc1.op.token_endpoint', "http://127.0.0.1:8080/c2id/token" + setting 'xpack.security.authc.realms.oidc.oidc1.op.jwkset_path', 'op-jwks.json' + setting 'xpack.security.authc.realms.oidc.oidc1.rp.redirect_uri', 'https://my.fantastic.rp/cb' + setting 'xpack.security.authc.realms.oidc.oidc1.rp.client_id', 'elasticsearch-rp' + keystore 'xpack.security.authc.realms.oidc.oidc1.rp.client_secret', 'b07efb7a1cf6ec9462afe7b6d3ab55c6c7880262aa61ac28dded292aca47c9a2' + setting 'xpack.security.authc.realms.oidc.oidc1.rp.response_type', 'id_token' + setting 'xpack.security.authc.realms.oidc.oidc1.claims.principal', 'sub' + setting 'xpack.security.authc.realms.pki.pki1.order', '3' + setting 'xpack.security.authc.realms.pki.pki1.certificate_authorities', '[ "testClient.crt" ]' + setting 'xpack.security.authc.realms.pki.pki1.delegation.enabled', 'true' + setting 'xpack.security.authc.realms.saml.saml1.order', '4' + setting 'xpack.security.authc.realms.saml.saml1.idp.entity_id', 'https://my-idp.org' + setting 'xpack.security.authc.realms.saml.saml1.idp.metadata.path', 'idp-docs-metadata.xml' + setting 'xpack.security.authc.realms.saml.saml1.sp.entity_id', 'https://kibana.org' + setting 'xpack.security.authc.realms.saml.saml1.sp.acs', 'https://kibana.org/api/security/v1/saml' + setting 'xpack.security.authc.realms.saml.saml1.attributes.principal', 'uid' + setting 'xpack.security.authc.realms.saml.saml1.attributes.name', 'urn:oid:2.5.4.3' + user username: 'test_admin' } buildRestTests.docs = fileTree(projectDir) { - // No snippets in here! - exclude 'build.gradle' - // That is where the snippets go, not where they come from! - exclude 'build' - // These file simply doesn't pass yet. We should figure out how to fix them. - exclude 'en/watcher/reference/actions.asciidoc' - exclude 'en/rest-api/security/ssl.asciidoc' + // No snippets in here! + exclude 'build.gradle' + // That is where the snippets go, not where they come from! + exclude 'build' + // These file simply doesn't pass yet. We should figure out how to fix them. + exclude 'en/watcher/reference/actions.asciidoc' + exclude 'en/rest-api/security/ssl.asciidoc' } Map setups = buildRestTests.setups @@ -110,7 +110,7 @@ setups['my_inactive_watch'] = ''' - match: { _id: "my_watch" } ''' setups['my_active_watch'] = setups['my_inactive_watch'].replace( - 'active: false', 'active: true') + 'active: false', 'active: true') // Used by SQL because it looks SQL-ish setups['library'] = ''' diff --git a/x-pack/plugin/analytics/build.gradle b/x-pack/plugin/analytics/build.gradle index f6521fa94bf..889a3235bde 100644 --- a/x-pack/plugin/analytics/build.gradle +++ b/x-pack/plugin/analytics/build.gradle @@ -2,10 +2,10 @@ evaluationDependsOn(xpackModule('core')) apply plugin: 'elasticsearch.esplugin' esplugin { - name 'x-pack-analytics' - description 'Elasticsearch Expanded Pack Plugin - Analytics' - classname 'org.elasticsearch.xpack.analytics.AnalyticsPlugin' - extendedPlugins = ['x-pack-core'] + name 'x-pack-analytics' + description 'Elasticsearch Expanded Pack Plugin - Analytics' + classname 'org.elasticsearch.xpack.analytics.AnalyticsPlugin' + extendedPlugins = ['x-pack-core'] } archivesBaseName = 'x-pack-analytics' @@ -14,10 +14,10 @@ compileTestJava.options.compilerArgs << "-Xlint:-rawtypes" dependencies { - compileOnly project(":server") - - compileOnly project(path: xpackModule('core'), configuration: 'default') - testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') + compileOnly project(":server") + + compileOnly project(path: xpackModule('core'), configuration: 'default') + testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') } integTest.enabled = false diff --git a/x-pack/plugin/build.gradle b/x-pack/plugin/build.gradle index 30d074f86d1..bb88ea9bd13 100644 --- a/x-pack/plugin/build.gradle +++ b/x-pack/plugin/build.gradle @@ -103,7 +103,7 @@ File nodeCert = file("$keystoreDir/testnode.crt") task copyKeyCerts(type: Copy) { from(project(':x-pack:plugin:core').file('src/test/resources/org/elasticsearch/xpack/security/transport/ssl/certs/simple/')) { include 'testnode.crt', 'testnode.pem' - } + } into keystoreDir } // Add keystores to test classpath: it expects it there diff --git a/x-pack/plugin/ccr/build.gradle b/x-pack/plugin/ccr/build.gradle index 7f07db1d540..505333543de 100644 --- a/x-pack/plugin/ccr/build.gradle +++ b/x-pack/plugin/ccr/build.gradle @@ -2,65 +2,65 @@ evaluationDependsOn(xpackModule('core')) apply plugin: 'elasticsearch.esplugin' esplugin { - name 'x-pack-ccr' - description 'Elasticsearch Expanded Pack Plugin - CCR' - classname 'org.elasticsearch.xpack.ccr.Ccr' - hasNativeController false - requiresKeystore true - extendedPlugins = ['x-pack-core'] + name 'x-pack-ccr' + description 'Elasticsearch Expanded Pack Plugin - CCR' + classname 'org.elasticsearch.xpack.ccr.Ccr' + hasNativeController false + requiresKeystore true + extendedPlugins = ['x-pack-core'] } archivesBaseName = 'x-pack-ccr' integTest.enabled = false // Integration Test classes that cannot run with the security manager -String[] noSecurityManagerITClasses = [ "**/CloseFollowerIndexIT.class" ] +String[] noSecurityManagerITClasses = ["**/CloseFollowerIndexIT.class"] task internalClusterTestNoSecurityManager(type: Test) { - description = 'Java fantasy integration tests with no security manager' - - include noSecurityManagerITClasses - systemProperty 'es.set.netty.runtime.available.processors', 'false' - systemProperty 'tests.security.manager', 'false' + description = 'Java fantasy integration tests with no security manager' + + include noSecurityManagerITClasses + systemProperty 'es.set.netty.runtime.available.processors', 'false' + systemProperty 'tests.security.manager', 'false' } // Instead we create a separate task to run the // tests based on ESIntegTestCase task internalClusterTest(type: Test) { - description = 'Java fantasy integration tests' - dependsOn internalClusterTestNoSecurityManager - mustRunAfter test - - include '**/*IT.class' - exclude noSecurityManagerITClasses - systemProperty 'es.set.netty.runtime.available.processors', 'false' + description = 'Java fantasy integration tests' + dependsOn internalClusterTestNoSecurityManager + mustRunAfter test + + include '**/*IT.class' + exclude noSecurityManagerITClasses + systemProperty 'es.set.netty.runtime.available.processors', 'false' } check.dependsOn internalClusterTest // add all sub-projects of the qa sub-project gradle.projectsEvaluated { - project.subprojects - .find { it.path == project.path + ":qa" } - .subprojects - .findAll { it.path.startsWith(project.path + ":qa") } - .each { check.dependsOn it.check } + project.subprojects + .find { it.path == project.path + ":qa" } + .subprojects + .findAll { it.path.startsWith(project.path + ":qa") } + .each { check.dependsOn it.check } } dependencies { - compileOnly project(":server") + compileOnly project(":server") - compileOnly project(path: xpackModule('core'), configuration: 'default') - testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') - testCompile project(path: xpackModule('monitoring'), configuration: 'testArtifacts') + compileOnly project(path: xpackModule('core'), configuration: 'default') + testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') + testCompile project(path: xpackModule('monitoring'), configuration: 'testArtifacts') } dependencyLicenses { - ignoreSha 'x-pack-core' + ignoreSha 'x-pack-core' } testingConventions.naming { - IT { - baseClass "org.elasticsearch.xpack.CcrIntegTestCase" - } + IT { + baseClass "org.elasticsearch.xpack.CcrIntegTestCase" + } } diff --git a/x-pack/plugin/ccr/qa/build.gradle b/x-pack/plugin/ccr/qa/build.gradle index 6a394895156..46609933699 100644 --- a/x-pack/plugin/ccr/qa/build.gradle +++ b/x-pack/plugin/ccr/qa/build.gradle @@ -14,5 +14,5 @@ subprojects { include 'rest-api-spec/api/**' } } - + } diff --git a/x-pack/plugin/ccr/qa/downgrade-to-basic-license/build.gradle b/x-pack/plugin/ccr/qa/downgrade-to-basic-license/build.gradle index a44a18f858c..6a7162fae4d 100644 --- a/x-pack/plugin/ccr/qa/downgrade-to-basic-license/build.gradle +++ b/x-pack/plugin/ccr/qa/downgrade-to-basic-license/build.gradle @@ -4,54 +4,54 @@ apply plugin: 'elasticsearch.testclusters' apply plugin: 'elasticsearch.standalone-test' dependencies { - testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') - testCompile project(path: xpackModule('ccr'), configuration: 'runtime') - testCompile project(':x-pack:plugin:ccr:qa') + testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') + testCompile project(path: xpackModule('ccr'), configuration: 'runtime') + testCompile project(':x-pack:plugin:ccr:qa') } task "leader-cluster"(type: RestIntegTestTask) { - mustRunAfter(precommit) - runner { - systemProperty 'tests.target_cluster', 'leader' - } + mustRunAfter(precommit) + runner { + systemProperty 'tests.target_cluster', 'leader' + } } testClusters."leader-cluster" { - testDistribution = 'DEFAULT' - setting 'xpack.license.self_generated.type', 'trial' + testDistribution = 'DEFAULT' + setting 'xpack.license.self_generated.type', 'trial' } File policyFile = file("${buildDir}/tmp/java.policy") task writeJavaPolicy { - doLast { - if (policyFile.parentFile.exists() == false && policyFile.parentFile.mkdirs() == false) { - throw new GradleException("failed to create temporary directory [${tmp}]") - } - policyFile.write( - [ - "grant {", - " permission java.io.FilePermission \"${-> testClusters."follow-cluster".getFirstNode().getServerLog()}\", \"read\";", - "};" - ].join("\n") - ) + doLast { + if (policyFile.parentFile.exists() == false && policyFile.parentFile.mkdirs() == false) { + throw new GradleException("failed to create temporary directory [${tmp}]") } + policyFile.write( + [ + "grant {", + " permission java.io.FilePermission \"${-> testClusters."follow-cluster".getFirstNode().getServerLog()}\", \"read\";", + "};" + ].join("\n") + ) + } } task "follow-cluster"(type: RestIntegTestTask) { - dependsOn 'writeJavaPolicy', "leader-cluster" - runner { - useCluster testClusters."leader-cluster" - systemProperty 'java.security.policy', "file://${policyFile}" - systemProperty 'tests.target_cluster', 'follow' - nonInputProperties.systemProperty 'tests.leader_host', "${-> testClusters."leader-cluster".getAllHttpSocketURI().get(0)}" - nonInputProperties.systemProperty 'log', "${-> testClusters."follow-cluster".getFirstNode().getServerLog()}" - } + dependsOn 'writeJavaPolicy', "leader-cluster" + runner { + useCluster testClusters."leader-cluster" + systemProperty 'java.security.policy', "file://${policyFile}" + systemProperty 'tests.target_cluster', 'follow' + nonInputProperties.systemProperty 'tests.leader_host', "${-> testClusters."leader-cluster".getAllHttpSocketURI().get(0)}" + nonInputProperties.systemProperty 'log', "${-> testClusters."follow-cluster".getFirstNode().getServerLog()}" + } } testClusters."follow-cluster" { - testDistribution = 'DEFAULT' - setting 'xpack.monitoring.collection.enabled', 'true' - setting 'xpack.license.self_generated.type', 'trial' - setting 'cluster.remote.leader_cluster.seeds', { "\"${testClusters."leader-cluster".getAllTransportPortURI().join(",")}\"" } + testDistribution = 'DEFAULT' + setting 'xpack.monitoring.collection.enabled', 'true' + setting 'xpack.license.self_generated.type', 'trial' + setting 'cluster.remote.leader_cluster.seeds', { "\"${testClusters."leader-cluster".getAllTransportPortURI().join(",")}\"" } } diff --git a/x-pack/plugin/ccr/qa/multi-cluster/build.gradle b/x-pack/plugin/ccr/qa/multi-cluster/build.gradle index 20e86c1d81f..050d696872a 100644 --- a/x-pack/plugin/ccr/qa/multi-cluster/build.gradle +++ b/x-pack/plugin/ccr/qa/multi-cluster/build.gradle @@ -4,61 +4,61 @@ apply plugin: 'elasticsearch.testclusters' apply plugin: 'elasticsearch.standalone-test' dependencies { - testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') - testCompile project(path: xpackModule('ccr'), configuration: 'runtime') - testCompile project(':x-pack:plugin:ccr:qa') + testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') + testCompile project(path: xpackModule('ccr'), configuration: 'runtime') + testCompile project(':x-pack:plugin:ccr:qa') } task "leader-cluster"(type: RestIntegTestTask) { - mustRunAfter(precommit) - runner { - systemProperty 'tests.target_cluster', 'leader' - } + mustRunAfter(precommit) + runner { + systemProperty 'tests.target_cluster', 'leader' + } } testClusters."leader-cluster" { - testDistribution = 'DEFAULT' - setting 'xpack.license.self_generated.type', 'trial' + testDistribution = 'DEFAULT' + setting 'xpack.license.self_generated.type', 'trial' } task "middle-cluster"(type: RestIntegTestTask) { - dependsOn "leader-cluster" - runner { - useCluster testClusters."leader-cluster" - systemProperty 'tests.target_cluster', 'middle' - nonInputProperties.systemProperty 'tests.leader_host', - "${-> testClusters."leader-cluster".getAllHttpSocketURI().get(0)}" - } + dependsOn "leader-cluster" + runner { + useCluster testClusters."leader-cluster" + systemProperty 'tests.target_cluster', 'middle' + nonInputProperties.systemProperty 'tests.leader_host', + "${-> testClusters."leader-cluster".getAllHttpSocketURI().get(0)}" + } } testClusters."middle-cluster" { - testDistribution = 'DEFAULT' - setting 'xpack.license.self_generated.type', 'trial' - setting 'cluster.remote.leader_cluster.seeds', - { "\"${testClusters."leader-cluster".getAllTransportPortURI().join(",")}\"" } + testDistribution = 'DEFAULT' + setting 'xpack.license.self_generated.type', 'trial' + setting 'cluster.remote.leader_cluster.seeds', + { "\"${testClusters."leader-cluster".getAllTransportPortURI().join(",")}\"" } } task 'follow-cluster'(type: RestIntegTestTask) { - dependsOn "leader-cluster", "middle-cluster" - runner { - useCluster testClusters."leader-cluster" - useCluster testClusters."middle-cluster" - systemProperty 'tests.target_cluster', 'follow' - nonInputProperties.systemProperty 'tests.leader_host', - "${-> testClusters."leader-cluster".getAllHttpSocketURI().get(0)}" - nonInputProperties.systemProperty 'tests.middle_host', - "${-> testClusters."middle-cluster".getAllHttpSocketURI().get(0)}" - } + dependsOn "leader-cluster", "middle-cluster" + runner { + useCluster testClusters."leader-cluster" + useCluster testClusters."middle-cluster" + systemProperty 'tests.target_cluster', 'follow' + nonInputProperties.systemProperty 'tests.leader_host', + "${-> testClusters."leader-cluster".getAllHttpSocketURI().get(0)}" + nonInputProperties.systemProperty 'tests.middle_host', + "${-> testClusters."middle-cluster".getAllHttpSocketURI().get(0)}" + } } testClusters."follow-cluster" { - testDistribution = 'DEFAULT' - setting 'xpack.monitoring.collection.enabled', 'true' - setting 'xpack.license.self_generated.type', 'trial' - setting 'cluster.remote.leader_cluster.seeds', - { "\"${testClusters."leader-cluster".getAllTransportPortURI().join(",")}\""} - setting 'cluster.remote.middle_cluster.seeds', - { "\"${testClusters."middle-cluster".getAllTransportPortURI().join(",")}\""} + testDistribution = 'DEFAULT' + setting 'xpack.monitoring.collection.enabled', 'true' + setting 'xpack.license.self_generated.type', 'trial' + setting 'cluster.remote.leader_cluster.seeds', + { "\"${testClusters."leader-cluster".getAllTransportPortURI().join(",")}\"" } + setting 'cluster.remote.middle_cluster.seeds', + { "\"${testClusters."middle-cluster".getAllTransportPortURI().join(",")}\"" } } check.dependsOn "follow-cluster" diff --git a/x-pack/plugin/ccr/qa/non-compliant-license/build.gradle b/x-pack/plugin/ccr/qa/non-compliant-license/build.gradle index 77d0a61c976..40e71a60199 100644 --- a/x-pack/plugin/ccr/qa/non-compliant-license/build.gradle +++ b/x-pack/plugin/ccr/qa/non-compliant-license/build.gradle @@ -4,35 +4,35 @@ apply plugin: 'elasticsearch.testclusters' apply plugin: 'elasticsearch.standalone-test' dependencies { - testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') - testCompile project(path: xpackModule('ccr'), configuration: 'runtime') - testCompile project(':x-pack:plugin:ccr:qa:') + testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') + testCompile project(path: xpackModule('ccr'), configuration: 'runtime') + testCompile project(':x-pack:plugin:ccr:qa:') } task 'leader-cluster'(type: RestIntegTestTask) { - mustRunAfter(precommit) - runner { - systemProperty 'tests.target_cluster', 'leader' - } + mustRunAfter(precommit) + runner { + systemProperty 'tests.target_cluster', 'leader' + } } testClusters.'leader-cluster' { - testDistribution = 'DEFAULT' + testDistribution = 'DEFAULT' } task 'follow-cluster'(type: RestIntegTestTask) { - dependsOn 'leader-cluster' - runner { - useCluster testClusters.'leader-cluster' - systemProperty 'tests.target_cluster', 'follow' - nonInputProperties.systemProperty 'tests.leader_host', - { "${testClusters.'follow-cluster'.getAllHttpSocketURI().get(0)}" } - } + dependsOn 'leader-cluster' + runner { + useCluster testClusters.'leader-cluster' + systemProperty 'tests.target_cluster', 'follow' + nonInputProperties.systemProperty 'tests.leader_host', + { "${testClusters.'follow-cluster'.getAllHttpSocketURI().get(0)}" } + } } testClusters.'follow-cluster' { - testDistribution = 'DEFAULT' - setting 'xpack.license.self_generated.type', 'trial' - setting 'cluster.remote.leader_cluster.seeds', - { "\"${testClusters.'leader-cluster'.getAllTransportPortURI().join(",")}\"" } + testDistribution = 'DEFAULT' + setting 'xpack.license.self_generated.type', 'trial' + setting 'cluster.remote.leader_cluster.seeds', + { "\"${testClusters.'leader-cluster'.getAllTransportPortURI().join(",")}\"" } } check.dependsOn "follow-cluster" diff --git a/x-pack/plugin/ccr/qa/rest/build.gradle b/x-pack/plugin/ccr/qa/rest/build.gradle index 8db29935a8d..4383db34f3e 100644 --- a/x-pack/plugin/ccr/qa/rest/build.gradle +++ b/x-pack/plugin/ccr/qa/rest/build.gradle @@ -4,26 +4,26 @@ apply plugin: 'elasticsearch.testclusters' apply plugin: 'elasticsearch.standalone-test' dependencies { - testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') - testCompile project(path: xpackModule('ccr'), configuration: 'runtime') + testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') + testCompile project(path: xpackModule('ccr'), configuration: 'runtime') } task restTest(type: RestIntegTestTask) { - mustRunAfter(precommit) + mustRunAfter(precommit) } testClusters.restTest { - testDistribution = 'DEFAULT' - // Disable assertions in FollowingEngineAssertions, otherwise an AssertionError is thrown before - // indexing a document directly in a follower index. In a rest test we like to test the exception - // that is thrown in production when indexing a document directly in a follower index. - jvmArgs '-da:org.elasticsearch.xpack.ccr.index.engine.FollowingEngineAssertions' - setting 'xpack.ml.enabled', 'false' - setting 'xpack.monitoring.enabled', 'false' - setting 'xpack.security.enabled', 'true' - setting 'xpack.license.self_generated.type', 'trial' - // TODO: reduce the need for superuser here - user username:'ccr-user', password: 'ccr-user-password', role: 'superuser' + testDistribution = 'DEFAULT' + // Disable assertions in FollowingEngineAssertions, otherwise an AssertionError is thrown before + // indexing a document directly in a follower index. In a rest test we like to test the exception + // that is thrown in production when indexing a document directly in a follower index. + jvmArgs '-da:org.elasticsearch.xpack.ccr.index.engine.FollowingEngineAssertions' + setting 'xpack.ml.enabled', 'false' + setting 'xpack.monitoring.enabled', 'false' + setting 'xpack.security.enabled', 'true' + setting 'xpack.license.self_generated.type', 'trial' + // TODO: reduce the need for superuser here + user username: 'ccr-user', password: 'ccr-user-password', role: 'superuser' } check.dependsOn restTest diff --git a/x-pack/plugin/ccr/qa/restart/build.gradle b/x-pack/plugin/ccr/qa/restart/build.gradle index 9dd401d0093..5b2078be537 100644 --- a/x-pack/plugin/ccr/qa/restart/build.gradle +++ b/x-pack/plugin/ccr/qa/restart/build.gradle @@ -5,50 +5,50 @@ apply plugin: 'elasticsearch.testclusters' apply plugin: 'elasticsearch.standalone-test' dependencies { - testCompile project(':x-pack:plugin:ccr:qa') + testCompile project(':x-pack:plugin:ccr:qa') } task 'leader-cluster'(type: RestIntegTestTask) { - mustRunAfter(precommit) - runner { - systemProperty 'tests.target_cluster', 'leader' - } + mustRunAfter(precommit) + runner { + systemProperty 'tests.target_cluster', 'leader' + } } testClusters.'leader-cluster' { - testDistribution = 'DEFAULT' - setting 'xpack.license.self_generated.type', 'trial' + testDistribution = 'DEFAULT' + setting 'xpack.license.self_generated.type', 'trial' } task 'follow-cluster'(type: RestIntegTestTask) { - dependsOn 'leader-cluster' - runner { - useCluster testClusters.'leader-cluster' - systemProperty 'tests.target_cluster', 'follow' - nonInputProperties.systemProperty 'tests.leader_host', - "${-> testClusters.'leader-cluster'.getAllHttpSocketURI().get(0)}" - } + dependsOn 'leader-cluster' + runner { + useCluster testClusters.'leader-cluster' + systemProperty 'tests.target_cluster', 'follow' + nonInputProperties.systemProperty 'tests.leader_host', + "${-> testClusters.'leader-cluster'.getAllHttpSocketURI().get(0)}" + } } testClusters.'follow-cluster' { - testDistribution = 'DEFAULT' - setting 'xpack.monitoring.collection.enabled', 'true' - setting 'xpack.license.self_generated.type', 'trial' - setting 'cluster.remote.leader_cluster.seeds', - { "\"${testClusters.'leader-cluster'.getAllTransportPortURI().get(0)}\"" } - nameCustomization = { 'follow' } + testDistribution = 'DEFAULT' + setting 'xpack.monitoring.collection.enabled', 'true' + setting 'xpack.license.self_generated.type', 'trial' + setting 'cluster.remote.leader_cluster.seeds', + { "\"${testClusters.'leader-cluster'.getAllTransportPortURI().get(0)}\"" } + nameCustomization = { 'follow' } } task followClusterRestartTest(type: RestTestRunnerTask) { - dependsOn tasks.'follow-cluster' - useCluster testClusters.'leader-cluster' - useCluster testClusters.'follow-cluster' + dependsOn tasks.'follow-cluster' + useCluster testClusters.'leader-cluster' + useCluster testClusters.'follow-cluster' - systemProperty 'tests.rest.load_packaged', 'false' - systemProperty 'tests.target_cluster', 'follow-restart' - doFirst { - testClusters.'follow-cluster'.restart() - nonInputProperties.systemProperty 'tests.leader_host', "${-> testClusters.'leader-cluster'.getAllHttpSocketURI().get(0)}" - nonInputProperties.systemProperty 'tests.rest.cluster', "${-> testClusters.'follow-cluster'.getAllHttpSocketURI().join(",")}" - } + systemProperty 'tests.rest.load_packaged', 'false' + systemProperty 'tests.target_cluster', 'follow-restart' + doFirst { + testClusters.'follow-cluster'.restart() + nonInputProperties.systemProperty 'tests.leader_host', "${-> testClusters.'leader-cluster'.getAllHttpSocketURI().get(0)}" + nonInputProperties.systemProperty 'tests.rest.cluster', "${-> testClusters.'follow-cluster'.getAllHttpSocketURI().join(",")}" + } } check.dependsOn followClusterRestartTest diff --git a/x-pack/plugin/ccr/qa/security/build.gradle b/x-pack/plugin/ccr/qa/security/build.gradle index a2f1235f590..64e83187602 100644 --- a/x-pack/plugin/ccr/qa/security/build.gradle +++ b/x-pack/plugin/ccr/qa/security/build.gradle @@ -4,48 +4,48 @@ apply plugin: 'elasticsearch.testclusters' apply plugin: 'elasticsearch.standalone-test' dependencies { - testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') - testCompile project(path: xpackModule('ccr'), configuration: 'runtime') - testCompile project(':x-pack:plugin:ccr:qa') + testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') + testCompile project(path: xpackModule('ccr'), configuration: 'runtime') + testCompile project(':x-pack:plugin:ccr:qa') } task 'leader-cluster'(type: RestIntegTestTask) { - mustRunAfter(precommit) - runner { - systemProperty 'tests.target_cluster', 'leader' - } + mustRunAfter(precommit) + runner { + systemProperty 'tests.target_cluster', 'leader' + } } testClusters.'leader-cluster' { - testDistribution = 'DEFAULT' - setting 'xpack.license.self_generated.type', 'trial' - setting 'xpack.security.enabled', 'true' - setting 'xpack.monitoring.enabled', 'false' - extraConfigFile 'roles.yml', file('leader-roles.yml') - user username: "test_admin", role: "superuser" - user username: "test_ccr", role: "ccruser" + testDistribution = 'DEFAULT' + setting 'xpack.license.self_generated.type', 'trial' + setting 'xpack.security.enabled', 'true' + setting 'xpack.monitoring.enabled', 'false' + extraConfigFile 'roles.yml', file('leader-roles.yml') + user username: "test_admin", role: "superuser" + user username: "test_ccr", role: "ccruser" } task 'follow-cluster'(type: RestIntegTestTask) { - dependsOn 'leader-cluster' - runner { - useCluster testClusters.'leader-cluster' - systemProperty 'tests.target_cluster', 'follow' - nonInputProperties.systemProperty 'tests.leader_host', "${-> testClusters.'leader-cluster'.getAllHttpSocketURI().get(0)}" - } + dependsOn 'leader-cluster' + runner { + useCluster testClusters.'leader-cluster' + systemProperty 'tests.target_cluster', 'follow' + nonInputProperties.systemProperty 'tests.leader_host', "${-> testClusters.'leader-cluster'.getAllHttpSocketURI().get(0)}" + } } testClusters.'follow-cluster' { - testDistribution = 'DEFAULT' - setting 'cluster.remote.leader_cluster.seeds', { - "\"${testClusters.'leader-cluster'.getAllTransportPortURI().join(",")}\"" - } - setting 'xpack.license.self_generated.type', 'trial' - setting 'xpack.security.enabled', 'true' - setting 'xpack.monitoring.collection.enabled', 'true' - extraConfigFile 'roles.yml', file('follower-roles.yml') - user username: "test_admin", role: "superuser" - user username: "test_ccr", role: "ccruser" + testDistribution = 'DEFAULT' + setting 'cluster.remote.leader_cluster.seeds', { + "\"${testClusters.'leader-cluster'.getAllTransportPortURI().join(",")}\"" + } + setting 'xpack.license.self_generated.type', 'trial' + setting 'xpack.security.enabled', 'true' + setting 'xpack.monitoring.collection.enabled', 'true' + extraConfigFile 'roles.yml', file('follower-roles.yml') + user username: "test_admin", role: "superuser" + user username: "test_ccr", role: "ccruser" } check.dependsOn 'follow-cluster' diff --git a/x-pack/plugin/core/build.gradle b/x-pack/plugin/core/build.gradle index fb3a31f6ab2..c4432731430 100644 --- a/x-pack/plugin/core/build.gradle +++ b/x-pack/plugin/core/build.gradle @@ -23,36 +23,36 @@ dependencyLicenses { } dependencies { - compileOnly project(":server") - compile "org.apache.httpcomponents:httpclient:${versions.httpclient}" - compile "org.apache.httpcomponents:httpcore:${versions.httpcore}" - compile "org.apache.httpcomponents:httpcore-nio:${versions.httpcore}" - compile "org.apache.httpcomponents:httpasyncclient:${versions.httpasyncclient}" + compileOnly project(":server") + compile "org.apache.httpcomponents:httpclient:${versions.httpclient}" + compile "org.apache.httpcomponents:httpcore:${versions.httpcore}" + compile "org.apache.httpcomponents:httpcore-nio:${versions.httpcore}" + compile "org.apache.httpcomponents:httpasyncclient:${versions.httpasyncclient}" - compile "commons-logging:commons-logging:${versions.commonslogging}" - compile "org.apache.logging.log4j:log4j-1.2-api:${versions.log4j}" - compile "commons-codec:commons-codec:${versions.commonscodec}" + compile "commons-logging:commons-logging:${versions.commonslogging}" + compile "org.apache.logging.log4j:log4j-1.2-api:${versions.log4j}" + compile "commons-codec:commons-codec:${versions.commonscodec}" - // security deps - compile 'com.unboundid:unboundid-ldapsdk:4.0.8' - compile project(path: ':modules:transport-netty4', configuration: 'runtime') - compile(project(path: ':plugins:transport-nio', configuration: 'runtime')) { - // TODO: core exclusion should not be necessary, since it is a transitive dep of all plugins - exclude group: "org.elasticsearch", module: "elasticsearch-core" - } + // security deps + compile 'com.unboundid:unboundid-ldapsdk:4.0.8' + compile project(path: ':modules:transport-netty4', configuration: 'runtime') + compile(project(path: ':plugins:transport-nio', configuration: 'runtime')) { + // TODO: core exclusion should not be necessary, since it is a transitive dep of all plugins + exclude group: "org.elasticsearch", module: "elasticsearch-core" + } - testCompile 'org.elasticsearch:securemock:1.2' - testCompile "org.elasticsearch:mocksocket:${versions.mocksocket}" - testCompile "org.apache.logging.log4j:log4j-slf4j-impl:${versions.log4j}" - testCompile "org.slf4j:slf4j-api:${versions.slf4j}" - testCompile project(path: ':modules:reindex', configuration: 'runtime') - testCompile project(path: ':modules:parent-join', configuration: 'runtime') - testCompile project(path: ':modules:lang-mustache', configuration: 'runtime') - testCompile project(path: ':modules:analysis-common', configuration: 'runtime') - testCompile project(':client:rest-high-level') - testCompile(project(':x-pack:license-tools')) { - transitive = false - } + testCompile 'org.elasticsearch:securemock:1.2' + testCompile "org.elasticsearch:mocksocket:${versions.mocksocket}" + testCompile "org.apache.logging.log4j:log4j-slf4j-impl:${versions.log4j}" + testCompile "org.slf4j:slf4j-api:${versions.slf4j}" + testCompile project(path: ':modules:reindex', configuration: 'runtime') + testCompile project(path: ':modules:parent-join', configuration: 'runtime') + testCompile project(path: ':modules:lang-mustache', configuration: 'runtime') + testCompile project(path: ':modules:analysis-common', configuration: 'runtime') + testCompile project(':client:rest-high-level') + testCompile(project(':x-pack:license-tools')) { + transitive = false + } } @@ -71,7 +71,7 @@ processResources { if (licenseKey != null) { println "Using provided license key from ${licenseKey}" } else if (snapshot) { - licenseKey = Paths.get(project.projectDir.path, 'snapshot.key') + licenseKey = Paths.get(project.projectDir.path, 'snapshot.key') } else { throw new IllegalArgumentException('Property license.key must be set for release build') } @@ -84,14 +84,14 @@ processResources { } forbiddenPatterns { - exclude '**/*.key' - exclude '**/*.p12' - exclude '**/*.der' - exclude '**/*.zip' + exclude '**/*.key' + exclude '**/*.p12' + exclude '**/*.der' + exclude '**/*.zip' } forbiddenApisMain { - signaturesFiles += files('forbidden/hasher-signatures.txt') + signaturesFiles += files('forbidden/hasher-signatures.txt') } compileJava.options.compilerArgs << "-Xlint:-rawtypes,-unchecked" @@ -105,34 +105,34 @@ licenseHeaders { // make LicenseSigner available for testing signed licenses sourceSets.test.resources { - srcDir 'src/main/config' + srcDir 'src/main/config' } test { - /* - * We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each - * other if we allow them to set the number of available processors as it's set-once in Netty. - */ - systemProperty 'es.set.netty.runtime.available.processors', 'false' + /* + * We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each + * other if we allow them to set the number of available processors as it's set-once in Netty. + */ + systemProperty 'es.set.netty.runtime.available.processors', 'false' } // TODO: don't publish test artifacts just to run messy tests, fix the tests! // https://github.com/elastic/x-plugins/issues/724 configurations { - testArtifacts.extendsFrom testRuntime + testArtifacts.extendsFrom testRuntime } task testJar(type: Jar) { - appendix 'test' - from sourceSets.test.output + appendix 'test' + from sourceSets.test.output } artifacts { - // normal es plugins do not publish the jar but we need to since users need it for Transport Clients and extensions - archives jar - testArtifacts testJar + // normal es plugins do not publish the jar but we need to since users need it for Transport Clients and extensions + archives jar + testArtifacts testJar } -thirdPartyAudit.ignoreMissingClasses ( +thirdPartyAudit.ignoreMissingClasses( //commons-logging optional dependencies 'org.apache.avalon.framework.logger.Logger', 'org.apache.log.Hierarchy', @@ -149,5 +149,5 @@ integTest.enabled = false // There are some integ tests that don't require a cluster, we still want to run those task internalClusterTest(type: Test) { - include "**/*IT.class" + include "**/*IT.class" } diff --git a/x-pack/plugin/deprecation/build.gradle b/x-pack/plugin/deprecation/build.gradle index bbf235131d7..072bda17a26 100644 --- a/x-pack/plugin/deprecation/build.gradle +++ b/x-pack/plugin/deprecation/build.gradle @@ -2,15 +2,15 @@ evaluationDependsOn(xpackModule('core')) apply plugin: 'elasticsearch.esplugin' esplugin { - name 'x-pack-deprecation' - description 'Elasticsearch Expanded Pack Plugin - Deprecation' - classname 'org.elasticsearch.xpack.deprecation.Deprecation' - extendedPlugins = ['x-pack-core'] + name 'x-pack-deprecation' + description 'Elasticsearch Expanded Pack Plugin - Deprecation' + classname 'org.elasticsearch.xpack.deprecation.Deprecation' + extendedPlugins = ['x-pack-core'] } archivesBaseName = 'x-pack-deprecation' dependencies { - compileOnly project(":x-pack:plugin:core") + compileOnly project(":x-pack:plugin:core") } integTest.enabled = false diff --git a/x-pack/plugin/enrich/build.gradle b/x-pack/plugin/enrich/build.gradle index 5d40ad3ff6d..d216a8bbaca 100644 --- a/x-pack/plugin/enrich/build.gradle +++ b/x-pack/plugin/enrich/build.gradle @@ -2,18 +2,18 @@ evaluationDependsOn(xpackModule('core')) apply plugin: 'elasticsearch.esplugin' esplugin { - name 'x-pack-enrich' - description 'Elasticsearch Expanded Pack Plugin - Enrich' - classname 'org.elasticsearch.xpack.enrich.EnrichPlugin' - extendedPlugins = ['x-pack-core'] + name 'x-pack-enrich' + description 'Elasticsearch Expanded Pack Plugin - Enrich' + classname 'org.elasticsearch.xpack.enrich.EnrichPlugin' + extendedPlugins = ['x-pack-core'] } archivesBaseName = 'x-pack-enrich' dependencies { - compileOnly project(path: xpackModule('core'), configuration: 'default') - testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') - testCompile project(path: ':modules:ingest-common') - testCompile project(path: xpackModule('monitoring'), configuration: 'testArtifacts') + compileOnly project(path: xpackModule('core'), configuration: 'default') + testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') + testCompile project(path: ':modules:ingest-common') + testCompile project(path: xpackModule('monitoring'), configuration: 'testArtifacts') } // No real integ tests in the module: @@ -21,20 +21,20 @@ integTest.enabled = false // Instead we create a separate task to run the tests based on ESIntegTestCase task internalClusterTest(type: Test) { - description = '🌈🌈🌈🦄 Welcome to fantasy integration tests land! 🦄🌈🌈🌈' - mustRunAfter test + description = '🌈🌈🌈🦄 Welcome to fantasy integration tests land! 🦄🌈🌈🌈' + mustRunAfter test - include '**/*IT.class' - systemProperty 'es.set.netty.runtime.available.processors', 'false' + include '**/*IT.class' + systemProperty 'es.set.netty.runtime.available.processors', 'false' } check.dependsOn internalClusterTest // add all sub-projects of the qa sub-project gradle.projectsEvaluated { - project.subprojects - .find { it.path == project.path + ":qa" } - .subprojects - .findAll { it.path.startsWith(project.path + ":qa") } - .each { check.dependsOn it.check } + project.subprojects + .find { it.path == project.path + ":qa" } + .subprojects + .findAll { it.path.startsWith(project.path + ":qa") } + .each { check.dependsOn it.check } } diff --git a/x-pack/plugin/enrich/qa/common/build.gradle b/x-pack/plugin/enrich/qa/common/build.gradle index 4b8496dc2fd..e1c6fb4f95b 100644 --- a/x-pack/plugin/enrich/qa/common/build.gradle +++ b/x-pack/plugin/enrich/qa/common/build.gradle @@ -2,5 +2,5 @@ apply plugin: 'elasticsearch.build' test.enabled = false dependencies { - compile project(':test:framework') -} \ No newline at end of file + compile project(':test:framework') +} diff --git a/x-pack/plugin/enrich/qa/rest-with-security/build.gradle b/x-pack/plugin/enrich/qa/rest-with-security/build.gradle index 91427991e3d..b9b90064c13 100644 --- a/x-pack/plugin/enrich/qa/rest-with-security/build.gradle +++ b/x-pack/plugin/enrich/qa/rest-with-security/build.gradle @@ -3,17 +3,18 @@ apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' dependencies { - testCompile project(path: xpackModule('enrich'), configuration: 'runtime') - testCompile project(path: xpackModule('core'), configuration: 'runtime') - testCompile project(path: xpackModule('enrich:qa:common'), configuration: 'runtime')} - -testClusters.integTest { - testDistribution = 'DEFAULT' - extraConfigFile 'roles.yml', file('roles.yml') - user username: "test_admin", password: "x-pack-test-password", role: "superuser" - user username: "test_enrich", password: "x-pack-test-password", role: "enrich_user,integ_test_role" - user username: "test_enrich_no_privs", password: "x-pack-test-password", role: "enrich_no_privs" - setting 'xpack.license.self_generated.type', 'basic' - setting 'xpack.security.enabled', 'true' - setting 'xpack.monitoring.collection.enabled', 'true' + testCompile project(path: xpackModule('enrich'), configuration: 'runtime') + testCompile project(path: xpackModule('core'), configuration: 'runtime') + testCompile project(path: xpackModule('enrich:qa:common'), configuration: 'runtime') +} + +testClusters.integTest { + testDistribution = 'DEFAULT' + extraConfigFile 'roles.yml', file('roles.yml') + user username: "test_admin", password: "x-pack-test-password", role: "superuser" + user username: "test_enrich", password: "x-pack-test-password", role: "enrich_user,integ_test_role" + user username: "test_enrich_no_privs", password: "x-pack-test-password", role: "enrich_no_privs" + setting 'xpack.license.self_generated.type', 'basic' + setting 'xpack.security.enabled', 'true' + setting 'xpack.monitoring.collection.enabled', 'true' } diff --git a/x-pack/plugin/enrich/qa/rest/build.gradle b/x-pack/plugin/enrich/qa/rest/build.gradle index c96782f074f..30ad9ff335e 100644 --- a/x-pack/plugin/enrich/qa/rest/build.gradle +++ b/x-pack/plugin/enrich/qa/rest/build.gradle @@ -3,12 +3,12 @@ apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' dependencies { - testCompile project(path: xpackModule('enrich'), configuration: 'runtime') - testCompile project(path: xpackModule('enrich:qa:common'), configuration: 'runtime') + testCompile project(path: xpackModule('enrich'), configuration: 'runtime') + testCompile project(path: xpackModule('enrich:qa:common'), configuration: 'runtime') } -testClusters.integTest { - testDistribution = 'DEFAULT' - setting 'xpack.license.self_generated.type', 'basic' - setting 'xpack.monitoring.collection.enabled', 'true' +testClusters.integTest { + testDistribution = 'DEFAULT' + setting 'xpack.license.self_generated.type', 'basic' + setting 'xpack.monitoring.collection.enabled', 'true' } diff --git a/x-pack/plugin/frozen-indices/build.gradle b/x-pack/plugin/frozen-indices/build.gradle index a298802188f..4f298887a35 100644 --- a/x-pack/plugin/frozen-indices/build.gradle +++ b/x-pack/plugin/frozen-indices/build.gradle @@ -2,16 +2,16 @@ evaluationDependsOn(xpackModule('core')) apply plugin: 'elasticsearch.esplugin' esplugin { - name 'frozen-indices' - description 'A plugin for the frozen indices functionality' - classname 'org.elasticsearch.xpack.frozen.FrozenIndices' - extendedPlugins = ['x-pack-core'] + name 'frozen-indices' + description 'A plugin for the frozen indices functionality' + classname 'org.elasticsearch.xpack.frozen.FrozenIndices' + extendedPlugins = ['x-pack-core'] } archivesBaseName = 'x-pack-frozen-indices' dependencies { - compileOnly project(path: xpackModule('core'), configuration: 'default') - testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') + compileOnly project(path: xpackModule('core'), configuration: 'default') + testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') } // xpack modules are installed in real clusters as the meta plugin, so diff --git a/x-pack/plugin/graph/build.gradle b/x-pack/plugin/graph/build.gradle index 0b96516dd73..8a46d5a5721 100644 --- a/x-pack/plugin/graph/build.gradle +++ b/x-pack/plugin/graph/build.gradle @@ -2,25 +2,25 @@ evaluationDependsOn(xpackModule('core')) apply plugin: 'elasticsearch.esplugin' esplugin { - name 'x-pack-graph' - description 'Elasticsearch Expanded Pack Plugin - Graph' - classname 'org.elasticsearch.xpack.graph.Graph' - extendedPlugins = ['x-pack-core'] + name 'x-pack-graph' + description 'Elasticsearch Expanded Pack Plugin - Graph' + classname 'org.elasticsearch.xpack.graph.Graph' + extendedPlugins = ['x-pack-core'] } archivesBaseName = 'x-pack-graph' dependencies { - compileOnly project(path: xpackModule('core'), configuration: 'default') - testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') + compileOnly project(path: xpackModule('core'), configuration: 'default') + testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') } // add all sub-projects of the qa sub-project gradle.projectsEvaluated { - project.subprojects - .find { it.path == project.path + ":qa" } - .subprojects - .findAll { it.path.startsWith(project.path + ":qa") } - .each { check.dependsOn it.check } + project.subprojects + .find { it.path == project.path + ":qa" } + .subprojects + .findAll { it.path.startsWith(project.path + ":qa") } + .each { check.dependsOn it.check } } integTest.enabled = false diff --git a/x-pack/plugin/graph/qa/build.gradle b/x-pack/plugin/graph/qa/build.gradle index 25b21503bed..44f567c00a8 100644 --- a/x-pack/plugin/graph/qa/build.gradle +++ b/x-pack/plugin/graph/qa/build.gradle @@ -1,17 +1,17 @@ import org.elasticsearch.gradle.test.RestIntegTestTask -subprojects { - // HACK: please fix this - // we want to add the rest api specs for xpack to qa tests, but we - // need to wait until after the project is evaluated to only apply - // to those that rest tests. this used to be done automatically - // when xpack was a plugin, but now there is no place with xpack as a module. - // instead, we should package these and make them easy to use for rest tests, - // but currently, they must be copied into the resources of the test runner. - project.tasks.withType(RestIntegTestTask) { - File xpackResources = new File(xpackProject('plugin').projectDir, 'src/test/resources') - project.copyRestSpec.from(xpackResources) { - include 'rest-api-spec/api/**' - } - } +subprojects { + // HACK: please fix this + // we want to add the rest api specs for xpack to qa tests, but we + // need to wait until after the project is evaluated to only apply + // to those that rest tests. this used to be done automatically + // when xpack was a plugin, but now there is no place with xpack as a module. + // instead, we should package these and make them easy to use for rest tests, + // but currently, they must be copied into the resources of the test runner. + project.tasks.withType(RestIntegTestTask) { + File xpackResources = new File(xpackProject('plugin').projectDir, 'src/test/resources') + project.copyRestSpec.from(xpackResources) { + include 'rest-api-spec/api/**' + } + } } diff --git a/x-pack/plugin/ilm/build.gradle b/x-pack/plugin/ilm/build.gradle index 7fec7486bec..9d6e18fca02 100644 --- a/x-pack/plugin/ilm/build.gradle +++ b/x-pack/plugin/ilm/build.gradle @@ -3,27 +3,27 @@ evaluationDependsOn(xpackModule('core')) apply plugin: 'elasticsearch.esplugin' esplugin { - name 'x-pack-ilm' - description 'Elasticsearch Expanded Pack Plugin - Index Lifecycle Management' - classname 'org.elasticsearch.xpack.ilm.IndexLifecycle' - extendedPlugins = ['x-pack-core'] - hasNativeController false - requiresKeystore true + name 'x-pack-ilm' + description 'Elasticsearch Expanded Pack Plugin - Index Lifecycle Management' + classname 'org.elasticsearch.xpack.ilm.IndexLifecycle' + extendedPlugins = ['x-pack-core'] + hasNativeController false + requiresKeystore true } archivesBaseName = 'x-pack-ilm' dependencies { - compileOnly project(path: xpackModule('core'), configuration: 'default') - testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') + compileOnly project(path: xpackModule('core'), configuration: 'default') + testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') } // add all sub-projects of the qa sub-project gradle.projectsEvaluated { - project.subprojects - .find { it.path == project.path + ":qa" } - .subprojects - .findAll { it.path.startsWith(project.path + ":qa") } - .each { check.dependsOn it.check } + project.subprojects + .find { it.path == project.path + ":qa" } + .subprojects + .findAll { it.path.startsWith(project.path + ":qa") } + .each { check.dependsOn it.check } } integTest.enabled = false diff --git a/x-pack/plugin/ilm/qa/build.gradle b/x-pack/plugin/ilm/qa/build.gradle index 330f5d189d1..46908e1d849 100644 --- a/x-pack/plugin/ilm/qa/build.gradle +++ b/x-pack/plugin/ilm/qa/build.gradle @@ -1,11 +1,11 @@ import org.elasticsearch.gradle.test.RestIntegTestTask subprojects { - project.tasks.withType(RestIntegTestTask) { - final File xPackResources = new File(xpackProject('plugin').projectDir, 'src/test/resources') - project.copyRestSpec.from(xPackResources) { - include 'rest-api-spec/api/**' - } + project.tasks.withType(RestIntegTestTask) { + final File xPackResources = new File(xpackProject('plugin').projectDir, 'src/test/resources') + project.copyRestSpec.from(xPackResources) { + include 'rest-api-spec/api/**' } + } } diff --git a/x-pack/plugin/ilm/qa/multi-cluster/build.gradle b/x-pack/plugin/ilm/qa/multi-cluster/build.gradle index a9eca7c4176..d8c5a825614 100644 --- a/x-pack/plugin/ilm/qa/multi-cluster/build.gradle +++ b/x-pack/plugin/ilm/qa/multi-cluster/build.gradle @@ -4,62 +4,62 @@ apply plugin: 'elasticsearch.testclusters' apply plugin: 'elasticsearch.standalone-test' dependencies { - testCompile project(':x-pack:plugin:ccr:qa') - testCompile project(':x-pack:plugin:core') - testCompile project(':x-pack:plugin:ilm') + testCompile project(':x-pack:plugin:ccr:qa') + testCompile project(':x-pack:plugin:core') + testCompile project(':x-pack:plugin:ilm') } File repoDir = file("$buildDir/testclusters/repo") task 'leader-cluster'(type: RestIntegTestTask) { - mustRunAfter(precommit) - runner { - systemProperty 'tests.target_cluster', 'leader' - /* To support taking index snapshots, we have to set path.repo setting */ - systemProperty 'tests.path.repo', repoDir.absolutePath - } + mustRunAfter(precommit) + runner { + systemProperty 'tests.target_cluster', 'leader' + /* To support taking index snapshots, we have to set path.repo setting */ + systemProperty 'tests.path.repo', repoDir.absolutePath + } } testClusters.'leader-cluster' { - testDistribution = 'DEFAULT' - setting 'path.repo', repoDir.absolutePath - setting 'xpack.ilm.enabled', 'true' - setting 'xpack.ccr.enabled', 'true' - setting 'xpack.security.enabled', 'false' - setting 'xpack.watcher.enabled', 'false' - setting 'xpack.monitoring.enabled', 'false' - setting 'xpack.ml.enabled', 'false' - setting 'xpack.license.self_generated.type', 'trial' - setting 'indices.lifecycle.poll_interval', '1000ms' + testDistribution = 'DEFAULT' + setting 'path.repo', repoDir.absolutePath + setting 'xpack.ilm.enabled', 'true' + setting 'xpack.ccr.enabled', 'true' + setting 'xpack.security.enabled', 'false' + setting 'xpack.watcher.enabled', 'false' + setting 'xpack.monitoring.enabled', 'false' + setting 'xpack.ml.enabled', 'false' + setting 'xpack.license.self_generated.type', 'trial' + setting 'indices.lifecycle.poll_interval', '1000ms' } task 'follow-cluster'(type: RestIntegTestTask) { - dependsOn 'leader-cluster' - runner { - useCluster testClusters.'leader-cluster' - systemProperty 'tests.target_cluster', 'follow' - nonInputProperties.systemProperty 'tests.leader_host', - "${-> testClusters."leader-cluster".getAllHttpSocketURI().get(0)}" - nonInputProperties.systemProperty 'tests.leader_remote_cluster_seed', - "${-> testClusters.'leader-cluster'.getAllTransportPortURI().get(0)}" - /* To support taking index snapshots, we have to set path.repo setting */ - systemProperty 'tests.path.repo', repoDir.absolutePath - } + dependsOn 'leader-cluster' + runner { + useCluster testClusters.'leader-cluster' + systemProperty 'tests.target_cluster', 'follow' + nonInputProperties.systemProperty 'tests.leader_host', + "${-> testClusters."leader-cluster".getAllHttpSocketURI().get(0)}" + nonInputProperties.systemProperty 'tests.leader_remote_cluster_seed', + "${-> testClusters.'leader-cluster'.getAllTransportPortURI().get(0)}" + /* To support taking index snapshots, we have to set path.repo setting */ + systemProperty 'tests.path.repo', repoDir.absolutePath + } } testClusters.'follow-cluster' { - testDistribution = 'DEFAULT' - setting 'path.repo', repoDir.absolutePath - setting 'xpack.ilm.enabled', 'true' - setting 'xpack.ccr.enabled', 'true' - setting 'xpack.security.enabled', 'false' - setting 'xpack.watcher.enabled', 'false' - setting 'xpack.monitoring.enabled', 'false' - setting 'xpack.ml.enabled', 'false' - setting 'xpack.license.self_generated.type', 'trial' - setting 'indices.lifecycle.poll_interval', '1000ms' - setting 'cluster.remote.leader_cluster.seeds', - { "\"${testClusters.'leader-cluster'.getAllTransportPortURI().get(0)}\"" } + testDistribution = 'DEFAULT' + setting 'path.repo', repoDir.absolutePath + setting 'xpack.ilm.enabled', 'true' + setting 'xpack.ccr.enabled', 'true' + setting 'xpack.security.enabled', 'false' + setting 'xpack.watcher.enabled', 'false' + setting 'xpack.monitoring.enabled', 'false' + setting 'xpack.ml.enabled', 'false' + setting 'xpack.license.self_generated.type', 'trial' + setting 'indices.lifecycle.poll_interval', '1000ms' + setting 'cluster.remote.leader_cluster.seeds', + { "\"${testClusters.'leader-cluster'.getAllTransportPortURI().get(0)}\"" } } check.dependsOn 'follow-cluster' diff --git a/x-pack/plugin/ilm/qa/multi-node/build.gradle b/x-pack/plugin/ilm/qa/multi-node/build.gradle index 77464b031aa..6703f281b93 100644 --- a/x-pack/plugin/ilm/qa/multi-node/build.gradle +++ b/x-pack/plugin/ilm/qa/multi-node/build.gradle @@ -5,26 +5,26 @@ apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' dependencies { - testCompile project(path: xpackProject('plugin').path, configuration: 'testArtifacts') + testCompile project(path: xpackProject('plugin').path, configuration: 'testArtifacts') } File repoDir = file("$buildDir/testclusters/repo") integTest.runner { - /* To support taking index snapshots, we have to set path.repo setting */ - systemProperty 'tests.path.repo', repoDir + /* To support taking index snapshots, we have to set path.repo setting */ + systemProperty 'tests.path.repo', repoDir } testClusters.integTest { - testDistribution = 'DEFAULT' - numberOfNodes = 4 - - setting 'path.repo', repoDir.absolutePath - setting 'xpack.ilm.enabled', 'true' - setting 'xpack.security.enabled', 'false' - setting 'xpack.watcher.enabled', 'false' - setting 'xpack.monitoring.enabled', 'false' - setting 'xpack.ml.enabled', 'false' - setting 'xpack.license.self_generated.type', 'trial' - setting 'indices.lifecycle.poll_interval', '1000ms' + testDistribution = 'DEFAULT' + numberOfNodes = 4 + + setting 'path.repo', repoDir.absolutePath + setting 'xpack.ilm.enabled', 'true' + setting 'xpack.security.enabled', 'false' + setting 'xpack.watcher.enabled', 'false' + setting 'xpack.monitoring.enabled', 'false' + setting 'xpack.ml.enabled', 'false' + setting 'xpack.license.self_generated.type', 'trial' + setting 'indices.lifecycle.poll_interval', '1000ms' } diff --git a/x-pack/plugin/ilm/qa/rest/build.gradle b/x-pack/plugin/ilm/qa/rest/build.gradle index 865f51c52ca..fa10fb0a021 100644 --- a/x-pack/plugin/ilm/qa/rest/build.gradle +++ b/x-pack/plugin/ilm/qa/rest/build.gradle @@ -4,29 +4,29 @@ apply plugin: 'elasticsearch.testclusters' apply plugin: 'elasticsearch.standalone-test' dependencies { - testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') - testCompile project(path: xpackModule('ilm'), configuration: 'runtime') + testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') + testCompile project(path: xpackModule('ilm'), configuration: 'runtime') } def clusterCredentials = [username: System.getProperty('tests.rest.cluster.username', 'test_admin'), - password: System.getProperty('tests.rest.cluster.password', 'x-pack-test-password')] + password: System.getProperty('tests.rest.cluster.password', 'x-pack-test-password')] task restTest(type: RestIntegTestTask) { - mustRunAfter(precommit) - runner { - systemProperty 'tests.rest.cluster.username', clusterCredentials.username - systemProperty 'tests.rest.cluster.password', clusterCredentials.password - } + mustRunAfter(precommit) + runner { + systemProperty 'tests.rest.cluster.username', clusterCredentials.username + systemProperty 'tests.rest.cluster.password', clusterCredentials.password + } } testClusters.restTest { - testDistribution = 'DEFAULT' - setting 'xpack.ilm.enabled', 'true' - setting 'xpack.ml.enabled', 'false' - setting 'xpack.monitoring.enabled', 'false' - setting 'xpack.security.enabled', 'true' - setting 'xpack.license.self_generated.type', 'trial' - user clusterCredentials + testDistribution = 'DEFAULT' + setting 'xpack.ilm.enabled', 'true' + setting 'xpack.ml.enabled', 'false' + setting 'xpack.monitoring.enabled', 'false' + setting 'xpack.security.enabled', 'true' + setting 'xpack.license.self_generated.type', 'trial' + user clusterCredentials } check.dependsOn restTest diff --git a/x-pack/plugin/ilm/qa/with-security/build.gradle b/x-pack/plugin/ilm/qa/with-security/build.gradle index 4c1c57a1bca..6882ad98b43 100644 --- a/x-pack/plugin/ilm/qa/with-security/build.gradle +++ b/x-pack/plugin/ilm/qa/with-security/build.gradle @@ -8,7 +8,7 @@ dependencies { } def clusterCredentials = [username: System.getProperty('tests.rest.cluster.username', 'test_admin'), - password: System.getProperty('tests.rest.cluster.password', 'x-pack-test-password')] + password: System.getProperty('tests.rest.cluster.password', 'x-pack-test-password')] integTest { runner { diff --git a/x-pack/plugin/logstash/build.gradle b/x-pack/plugin/logstash/build.gradle index aad286db95a..ae3f04321e0 100644 --- a/x-pack/plugin/logstash/build.gradle +++ b/x-pack/plugin/logstash/build.gradle @@ -2,16 +2,16 @@ evaluationDependsOn(xpackModule('core')) apply plugin: 'elasticsearch.esplugin' esplugin { - name 'x-pack-logstash' - description 'Elasticsearch Expanded Pack Plugin - Logstash' - classname 'org.elasticsearch.xpack.logstash.Logstash' - extendedPlugins = ['x-pack-core'] + name 'x-pack-logstash' + description 'Elasticsearch Expanded Pack Plugin - Logstash' + classname 'org.elasticsearch.xpack.logstash.Logstash' + extendedPlugins = ['x-pack-core'] } archivesBaseName = 'x-pack-logstash' dependencies { - compileOnly project(path: xpackModule('core'), configuration: 'default') - testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') + compileOnly project(path: xpackModule('core'), configuration: 'default') + testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') } integTest.enabled = false diff --git a/x-pack/plugin/mapper-flattened/build.gradle b/x-pack/plugin/mapper-flattened/build.gradle index c4dd270b0c4..979da98fdc0 100644 --- a/x-pack/plugin/mapper-flattened/build.gradle +++ b/x-pack/plugin/mapper-flattened/build.gradle @@ -9,16 +9,16 @@ evaluationDependsOn(xpackModule('core')) apply plugin: 'elasticsearch.esplugin' esplugin { - name 'flattened' - description 'Module for the flattened field type, which allows JSON objects to be flattened into a single field.' - classname 'org.elasticsearch.xpack.flattened.FlattenedMapperPlugin' - extendedPlugins = ['x-pack-core'] + name 'flattened' + description 'Module for the flattened field type, which allows JSON objects to be flattened into a single field.' + classname 'org.elasticsearch.xpack.flattened.FlattenedMapperPlugin' + extendedPlugins = ['x-pack-core'] } archivesBaseName = 'x-pack-flattened' dependencies { - compileOnly project(path: xpackModule('core'), configuration: 'default') - testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') + compileOnly project(path: xpackModule('core'), configuration: 'default') + testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') } integTest.enabled = false diff --git a/x-pack/plugin/ml/build.gradle b/x-pack/plugin/ml/build.gradle index 6e7078d8361..bd3bb8d1b1e 100644 --- a/x-pack/plugin/ml/build.gradle +++ b/x-pack/plugin/ml/build.gradle @@ -2,95 +2,95 @@ evaluationDependsOn(xpackModule('core')) apply plugin: 'elasticsearch.esplugin' esplugin { - name 'x-pack-ml' - description 'Elasticsearch Expanded Pack Plugin - Machine Learning' - classname 'org.elasticsearch.xpack.ml.MachineLearning' - hasNativeController true - extendedPlugins = ['x-pack-core', 'lang-painless'] + name 'x-pack-ml' + description 'Elasticsearch Expanded Pack Plugin - Machine Learning' + classname 'org.elasticsearch.xpack.ml.MachineLearning' + hasNativeController true + extendedPlugins = ['x-pack-core', 'lang-painless'] } repositories { - ivy { - name "ml-cpp" - url System.getProperty('build.ml_cpp.repo', 'https://prelert-artifacts.s3.amazonaws.com') - metadataSources { - // no repository metadata, look directly for the artifact - artifact() - } - patternLayout { - artifact "maven/org/elasticsearch/ml/ml-cpp/[revision]/ml-cpp-[revision].[ext]" - } + ivy { + name "ml-cpp" + url System.getProperty('build.ml_cpp.repo', 'https://prelert-artifacts.s3.amazonaws.com') + metadataSources { + // no repository metadata, look directly for the artifact + artifact() } + patternLayout { + artifact "maven/org/elasticsearch/ml/ml-cpp/[revision]/ml-cpp-[revision].[ext]" + } + } } configurations { - nativeBundle { - resolutionStrategy.dependencySubstitution { - if (findProject(':ml-cpp') != null) { - substitute module("org.elasticsearch.ml:ml-cpp") with project(":ml-cpp") - } - } - resolutionStrategy.cacheChangingModulesFor 2, 'hours' + nativeBundle { + resolutionStrategy.dependencySubstitution { + if (findProject(':ml-cpp') != null) { + substitute module("org.elasticsearch.ml:ml-cpp") with project(":ml-cpp") + } } + resolutionStrategy.cacheChangingModulesFor 2, 'hours' + } } bundlePlugin { - dependsOn configurations.nativeBundle - from { - project.zipTree(configurations.nativeBundle.singleFile) - } + dependsOn configurations.nativeBundle + from { + project.zipTree(configurations.nativeBundle.singleFile) + } - // We don't ship the individual nativeBundle licenses - instead - // they get combined into the top level NOTICES file we ship - exclude 'platform/licenses/**' + // We don't ship the individual nativeBundle licenses - instead + // they get combined into the top level NOTICES file we ship + exclude 'platform/licenses/**' } dependencies { - compileOnly project(':modules:lang-painless:spi') - compileOnly project(path: xpackModule('core'), configuration: 'default') - testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') - // This should not be here - testCompile project(path: xpackModule('security'), configuration: 'testArtifacts') + compileOnly project(':modules:lang-painless:spi') + compileOnly project(path: xpackModule('core'), configuration: 'default') + testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') + // This should not be here + testCompile project(path: xpackModule('security'), configuration: 'testArtifacts') - // ml deps - compile project(':libs:elasticsearch-grok') - compile "com.ibm.icu:icu4j:${versions.icu4j}" - compile "net.sf.supercsv:super-csv:${versions.supercsv}" - nativeBundle("org.elasticsearch.ml:ml-cpp:${project.version}@zip") { - changing = true - } - testCompile 'org.ini4j:ini4j:0.5.2' + // ml deps + compile project(':libs:elasticsearch-grok') + compile "com.ibm.icu:icu4j:${versions.icu4j}" + compile "net.sf.supercsv:super-csv:${versions.supercsv}" + nativeBundle("org.elasticsearch.ml:ml-cpp:${project.version}@zip") { + changing = true + } + testCompile 'org.ini4j:ini4j:0.5.2' } configurations { - testArtifacts.extendsFrom testRuntime + testArtifacts.extendsFrom testRuntime } task testJar(type: Jar) { - appendix 'test' - from sourceSets.test.output + appendix 'test' + from sourceSets.test.output } artifacts { - // normal es plugins do not publish the jar but we need to since users need it for Transport Clients and extensions - archives jar - testArtifacts testJar + // normal es plugins do not publish the jar but we need to since users need it for Transport Clients and extensions + archives jar + testArtifacts testJar } task extractNativeLicenses(type: Copy) { - dependsOn configurations.nativeBundle - into "${buildDir}" - from { - project.zipTree(configurations.nativeBundle.singleFile) - } - include 'platform/licenses/**' + dependsOn configurations.nativeBundle + into "${buildDir}" + from { + project.zipTree(configurations.nativeBundle.singleFile) + } + include 'platform/licenses/**' } project.afterEvaluate { - // Add an extra licenses directory to the combined notices - project.tasks.findByName('generateNotice').dependsOn extractNativeLicenses - project.tasks.findByName('generateNotice').licensesDir new File("${project.buildDir}/platform/licenses") - project.tasks.findByName('generateNotice').outputs.upToDateWhen { - extractNativeLicenses.state.upToDate - } + // Add an extra licenses directory to the combined notices + project.tasks.findByName('generateNotice').dependsOn extractNativeLicenses + project.tasks.findByName('generateNotice').licensesDir new File("${project.buildDir}/platform/licenses") + project.tasks.findByName('generateNotice').outputs.upToDateWhen { + extractNativeLicenses.state.upToDate + } } // xpack modules are installed in real clusters as the meta plugin, so @@ -101,21 +101,21 @@ integTest.enabled = false // Instead we create a separate task to run the // tests based on ESIntegTestCase task internalClusterTest(type: Test) { - description = 'Multi-node tests' + description = 'Multi-node tests' - include '**/*IT.class' - systemProperty 'es.set.netty.runtime.available.processors', 'false' + include '**/*IT.class' + systemProperty 'es.set.netty.runtime.available.processors', 'false' } check.dependsOn internalClusterTest internalClusterTest.mustRunAfter test // add all sub-projects of the qa sub-project gradle.projectsEvaluated { - project.subprojects - .find { it.path == project.path + ":qa" } - .subprojects - .findAll { it.path.startsWith(project.path + ":qa") } - .each { check.dependsOn it.check } + project.subprojects + .find { it.path == project.path + ":qa" } + .subprojects + .findAll { it.path.startsWith(project.path + ":qa") } + .each { check.dependsOn it.check } } // also add an "alias" task to make typing on the command line easier diff --git a/x-pack/plugin/ml/qa/basic-multi-node/build.gradle b/x-pack/plugin/ml/qa/basic-multi-node/build.gradle index 2d90950791c..85230609743 100644 --- a/x-pack/plugin/ml/qa/basic-multi-node/build.gradle +++ b/x-pack/plugin/ml/qa/basic-multi-node/build.gradle @@ -3,17 +3,17 @@ apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' dependencies { - testCompile project(":x-pack:plugin:core") - testCompile project(path: xpackModule('ml'), configuration: 'runtime') + testCompile project(":x-pack:plugin:core") + testCompile project(path: xpackModule('ml'), configuration: 'runtime') } testClusters.integTest { - testDistribution = 'DEFAULT' - numberOfNodes = 3 - setting 'xpack.ilm.enabled', 'false' - setting 'xpack.security.enabled', 'false' - setting 'xpack.monitoring.enabled', 'false' - setting 'xpack.watcher.enabled', 'false' - setting 'xpack.ml.enabled', 'true' - setting 'xpack.license.self_generated.type', 'trial' + testDistribution = 'DEFAULT' + numberOfNodes = 3 + setting 'xpack.ilm.enabled', 'false' + setting 'xpack.security.enabled', 'false' + setting 'xpack.monitoring.enabled', 'false' + setting 'xpack.watcher.enabled', 'false' + setting 'xpack.ml.enabled', 'true' + setting 'xpack.license.self_generated.type', 'trial' } diff --git a/x-pack/plugin/ml/qa/build.gradle b/x-pack/plugin/ml/qa/build.gradle index 35bd236df5c..012e25f5d4f 100644 --- a/x-pack/plugin/ml/qa/build.gradle +++ b/x-pack/plugin/ml/qa/build.gradle @@ -1,17 +1,17 @@ import org.elasticsearch.gradle.test.RestIntegTestTask subprojects { - // HACK: please fix this - // we want to add the rest api specs for xpack to qa tests, but we - // need to wait until after the project is evaluated to only apply - // to those that rest tests. this used to be done automatically - // when xpack was a plugin, but now there is no place with xpack as a module. - // instead, we should package these and make them easy to use for rest tests, - // but currently, they must be copied into the resources of the test runner. - project.tasks.withType(RestIntegTestTask) { - File xpackResources = new File(xpackProject('plugin').projectDir, 'src/test/resources') - project.copyRestSpec.from(xpackResources) { - include 'rest-api-spec/api/**' - } + // HACK: please fix this + // we want to add the rest api specs for xpack to qa tests, but we + // need to wait until after the project is evaluated to only apply + // to those that rest tests. this used to be done automatically + // when xpack was a plugin, but now there is no place with xpack as a module. + // instead, we should package these and make them easy to use for rest tests, + // but currently, they must be copied into the resources of the test runner. + project.tasks.withType(RestIntegTestTask) { + File xpackResources = new File(xpackProject('plugin').projectDir, 'src/test/resources') + project.copyRestSpec.from(xpackResources) { + include 'rest-api-spec/api/**' } + } } diff --git a/x-pack/plugin/ml/qa/disabled/build.gradle b/x-pack/plugin/ml/qa/disabled/build.gradle index f066e7e5bcf..3ffaee2256b 100644 --- a/x-pack/plugin/ml/qa/disabled/build.gradle +++ b/x-pack/plugin/ml/qa/disabled/build.gradle @@ -3,13 +3,13 @@ apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' dependencies { - testCompile project(":x-pack:plugin:core") - testCompile project(path: xpackModule('ml'), configuration: 'runtime') + testCompile project(":x-pack:plugin:core") + testCompile project(path: xpackModule('ml'), configuration: 'runtime') } testClusters.integTest { - testDistribution = 'DEFAULT' - setting 'xpack.ilm.enabled', 'false' - setting 'xpack.security.enabled', 'false' - setting 'xpack.ml.enabled', 'false' + testDistribution = 'DEFAULT' + setting 'xpack.ilm.enabled', 'false' + setting 'xpack.security.enabled', 'false' + setting 'xpack.ml.enabled', 'false' } diff --git a/x-pack/plugin/ml/qa/ml-with-security/build.gradle b/x-pack/plugin/ml/qa/ml-with-security/build.gradle index e330d032c0a..1929b03ba43 100644 --- a/x-pack/plugin/ml/qa/ml-with-security/build.gradle +++ b/x-pack/plugin/ml/qa/ml-with-security/build.gradle @@ -18,7 +18,7 @@ task copyMlRestTests(type: Copy) { integTest.runner { dependsOn copyMlRestTests } -integTest.runner { +integTest.runner { systemProperty 'tests.rest.blacklist', [ // Remove this test because it doesn't call an ML endpoint and we don't want // to grant extra permissions to the users used in this test suite @@ -187,7 +187,7 @@ integTest.runner { } -testClusters.integTest { +testClusters.integTest { testDistribution = 'DEFAULT' extraConfigFile 'roles.yml', file('roles.yml') user username: "x_pack_rest_user", password: "x-pack-test-password" diff --git a/x-pack/plugin/ml/qa/native-multi-node-tests/build.gradle b/x-pack/plugin/ml/qa/native-multi-node-tests/build.gradle index 69732625111..419f5d129a6 100644 --- a/x-pack/plugin/ml/qa/native-multi-node-tests/build.gradle +++ b/x-pack/plugin/ml/qa/native-multi-node-tests/build.gradle @@ -3,10 +3,10 @@ apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' dependencies { - testCompile project(path: xpackModule('core'), configuration: 'default') - testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') - testCompile project(path: xpackModule('ml'), configuration: 'runtime') - testCompile project(path: xpackModule('ml'), configuration: 'testArtifacts') + testCompile project(path: xpackModule('core'), configuration: 'default') + testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') + testCompile project(path: xpackModule('ml'), configuration: 'runtime') + testCompile project(path: xpackModule('ml'), configuration: 'testArtifacts') } // location for keys and certificates @@ -15,49 +15,49 @@ File nodeKey = file("$keystoreDir/testnode.pem") File nodeCert = file("$keystoreDir/testnode.crt") // Add key and certs to test classpath: it expects it there task copyKeyCerts(type: Copy) { - from(project(':x-pack:plugin:core').file('src/test/resources/org/elasticsearch/xpack/security/transport/ssl/certs/simple/')) { - include 'testnode.crt', 'testnode.pem' - } - into keystoreDir + from(project(':x-pack:plugin:core').file('src/test/resources/org/elasticsearch/xpack/security/transport/ssl/certs/simple/')) { + include 'testnode.crt', 'testnode.pem' + } + into keystoreDir } // Add keys and cets to test classpath: it expects it there sourceSets.test.resources.srcDir(keystoreDir) processTestResources.dependsOn(copyKeyCerts) integTest { - dependsOn copyKeyCerts - runner { - /* - * We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each - * other if we allow them to set the number of available processors as it's set-once in Netty. - */ - systemProperty 'es.set.netty.runtime.available.processors', 'false' - } + dependsOn copyKeyCerts + runner { + /* + * We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each + * other if we allow them to set the number of available processors as it's set-once in Netty. + */ + systemProperty 'es.set.netty.runtime.available.processors', 'false' + } } testClusters.integTest { - numberOfNodes = 3 - testDistribution = 'DEFAULT' + numberOfNodes = 3 + testDistribution = 'DEFAULT' - setting 'xpack.security.enabled', 'true' - setting 'xpack.ml.enabled', 'true' - setting 'xpack.watcher.enabled', 'false' - setting 'xpack.ilm.enabled', 'false' - setting 'xpack.monitoring.enabled', 'false' - setting 'xpack.security.authc.token.enabled', 'true' - setting 'xpack.security.transport.ssl.enabled', 'true' - setting 'xpack.security.transport.ssl.key', nodeKey.name - setting 'xpack.security.transport.ssl.certificate', nodeCert.name - setting 'xpack.security.transport.ssl.verification_mode', 'certificate' - setting 'xpack.security.audit.enabled', 'false' - setting 'xpack.license.self_generated.type', 'trial' - setting 'xpack.ml.min_disk_space_off_heap', '200mb' + setting 'xpack.security.enabled', 'true' + setting 'xpack.ml.enabled', 'true' + setting 'xpack.watcher.enabled', 'false' + setting 'xpack.ilm.enabled', 'false' + setting 'xpack.monitoring.enabled', 'false' + setting 'xpack.security.authc.token.enabled', 'true' + setting 'xpack.security.transport.ssl.enabled', 'true' + setting 'xpack.security.transport.ssl.key', nodeKey.name + setting 'xpack.security.transport.ssl.certificate', nodeCert.name + setting 'xpack.security.transport.ssl.verification_mode', 'certificate' + setting 'xpack.security.audit.enabled', 'false' + setting 'xpack.license.self_generated.type', 'trial' + setting 'xpack.ml.min_disk_space_off_heap', '200mb' - keystore 'bootstrap.password', 'x-pack-test-password' - keystore 'xpack.security.transport.ssl.secure_key_passphrase', 'testnode' + keystore 'bootstrap.password', 'x-pack-test-password' + keystore 'xpack.security.transport.ssl.secure_key_passphrase', 'testnode' - user username: "x_pack_rest_user", password: "x-pack-test-password" + user username: "x_pack_rest_user", password: "x-pack-test-password" - extraConfigFile nodeKey.name, nodeKey - extraConfigFile nodeCert.name, nodeCert + extraConfigFile nodeKey.name, nodeKey + extraConfigFile nodeCert.name, nodeCert } diff --git a/x-pack/plugin/ml/qa/no-bootstrap-tests/build.gradle b/x-pack/plugin/ml/qa/no-bootstrap-tests/build.gradle index e1131a4fa8a..4dec7510727 100644 --- a/x-pack/plugin/ml/qa/no-bootstrap-tests/build.gradle +++ b/x-pack/plugin/ml/qa/no-bootstrap-tests/build.gradle @@ -1,6 +1,6 @@ apply plugin: 'elasticsearch.standalone-test' dependencies { - testCompile project(":x-pack:plugin:core") - testCompile project(path: xpackModule('ml'), configuration: 'runtime') -} \ No newline at end of file + testCompile project(":x-pack:plugin:core") + testCompile project(path: xpackModule('ml'), configuration: 'runtime') +} diff --git a/x-pack/plugin/monitoring/build.gradle b/x-pack/plugin/monitoring/build.gradle index 6e45c830e2d..c2e93e4bd8c 100644 --- a/x-pack/plugin/monitoring/build.gradle +++ b/x-pack/plugin/monitoring/build.gradle @@ -2,46 +2,46 @@ evaluationDependsOn(xpackModule('core')) apply plugin: 'elasticsearch.esplugin' esplugin { - name 'x-pack-monitoring' - description 'Elasticsearch Expanded Pack Plugin - Monitoring' - classname 'org.elasticsearch.xpack.monitoring.Monitoring' - extendedPlugins = ['x-pack-core'] + name 'x-pack-monitoring' + description 'Elasticsearch Expanded Pack Plugin - Monitoring' + classname 'org.elasticsearch.xpack.monitoring.Monitoring' + extendedPlugins = ['x-pack-core'] } archivesBaseName = 'x-pack-monitoring' dependencies { - compileOnly project(path: xpackModule('core'), configuration: 'default') - testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') + compileOnly project(path: xpackModule('core'), configuration: 'default') + testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') - // monitoring deps - compile project(':client:rest') - compile project(':client:sniffer') + // monitoring deps + compile project(':client:rest') + compile project(':client:sniffer') - // baz - this goes away after we separate out the actions #27759 - testCompile project(xpackModule('watcher')) + // baz - this goes away after we separate out the actions #27759 + testCompile project(xpackModule('watcher')) - testCompile project(xpackModule('ilm')) + testCompile project(xpackModule('ilm')) } compileJava.options.compilerArgs << "-Xlint:-rawtypes,-unchecked" compileTestJava.options.compilerArgs << "-Xlint:-rawtypes,-unchecked" configurations { - testArtifacts.extendsFrom testRuntime + testArtifacts.extendsFrom testRuntime } task testJar(type: Jar) { - appendix 'test' - from sourceSets.test.output + appendix 'test' + from sourceSets.test.output } artifacts { - // normal es plugins do not publish the jar but we need to since users need it for Transport Clients and extensions - archives jar - testArtifacts testJar + // normal es plugins do not publish the jar but we need to since users need it for Transport Clients and extensions + archives jar + testArtifacts testJar } dependencyLicenses { - mapping from: /http.*/, to: 'httpclient' // pulled in by rest client - mapping from: /commons-.*/, to: 'commons' // pulled in by rest client + mapping from: /http.*/, to: 'httpclient' // pulled in by rest client + mapping from: /commons-.*/, to: 'commons' // pulled in by rest client } // xpack modules are installed in real clusters as the meta plugin, so @@ -52,11 +52,11 @@ integTest.enabled = false // Instead we create a separate task to run the // tests based on ESIntegTestCase task internalClusterTest(type: Test) { - description = 'Multi-node tests' - mustRunAfter test + description = 'Multi-node tests' + mustRunAfter test - include '**/*IT.class' - systemProperty 'es.set.netty.runtime.available.processors', 'false' + include '**/*IT.class' + systemProperty 'es.set.netty.runtime.available.processors', 'false' } check.dependsOn internalClusterTest diff --git a/x-pack/plugin/rollup/build.gradle b/x-pack/plugin/rollup/build.gradle index 4650927ad87..96f679ac30a 100644 --- a/x-pack/plugin/rollup/build.gradle +++ b/x-pack/plugin/rollup/build.gradle @@ -2,10 +2,10 @@ evaluationDependsOn(xpackModule('core')) apply plugin: 'elasticsearch.esplugin' esplugin { - name 'x-pack-rollup' - description 'Elasticsearch Expanded Pack Plugin - Rollup' - classname 'org.elasticsearch.xpack.rollup.Rollup' - extendedPlugins = ['x-pack-core'] + name 'x-pack-rollup' + description 'Elasticsearch Expanded Pack Plugin - Rollup' + classname 'org.elasticsearch.xpack.rollup.Rollup' + extendedPlugins = ['x-pack-core'] } archivesBaseName = 'x-pack-rollup' @@ -14,10 +14,10 @@ compileTestJava.options.compilerArgs << "-Xlint:-rawtypes" dependencies { - compileOnly project(":server") - - compileOnly project(path: xpackModule('core'), configuration: 'default') - testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') + compileOnly project(":server") + + compileOnly project(path: xpackModule('core'), configuration: 'default') + testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') } integTest.enabled = false diff --git a/x-pack/plugin/search-business-rules/build.gradle b/x-pack/plugin/search-business-rules/build.gradle index c0a289b0c4e..c9d3034ae18 100644 --- a/x-pack/plugin/search-business-rules/build.gradle +++ b/x-pack/plugin/search-business-rules/build.gradle @@ -3,10 +3,10 @@ evaluationDependsOn(xpackModule('core')) apply plugin: 'elasticsearch.esplugin' esplugin { - name 'search-business-rules' - description 'A plugin for applying business rules to search result rankings' - classname 'org.elasticsearch.xpack.searchbusinessrules.SearchBusinessRules' - extendedPlugins = ['x-pack-core'] + name 'search-business-rules' + description 'A plugin for applying business rules to search result rankings' + classname 'org.elasticsearch.xpack.searchbusinessrules.SearchBusinessRules' + extendedPlugins = ['x-pack-core'] } archivesBaseName = 'x-pack-searchbusinessrules' @@ -16,23 +16,23 @@ integTest.enabled = false // Instead we create a separate task to run the // tests based on ESIntegTestCase task internalClusterTest(type: Test) { - description = 'Java fantasy integration tests' - mustRunAfter test + description = 'Java fantasy integration tests' + mustRunAfter test - include '**/*IT.class' + include '**/*IT.class' } check.dependsOn internalClusterTest dependencies { - compileOnly project(path: xpackModule('core'), configuration: 'default') - testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') - testCompile project(":test:framework") + compileOnly project(path: xpackModule('core'), configuration: 'default') + testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') + testCompile project(":test:framework") } // copied from CCR dependencyLicenses { - ignoreSha 'x-pack-core' + ignoreSha 'x-pack-core' } //testingConventions.naming { diff --git a/x-pack/plugin/security/build.gradle b/x-pack/plugin/security/build.gradle index 30ca038fb22..7476be34c92 100644 --- a/x-pack/plugin/security/build.gradle +++ b/x-pack/plugin/security/build.gradle @@ -5,324 +5,324 @@ evaluationDependsOn(xpackModule('core')) apply plugin: 'elasticsearch.esplugin' apply plugin: 'nebula.maven-scm' esplugin { - name 'x-pack-security' - description 'Elasticsearch Expanded Pack Plugin - Security' - classname 'org.elasticsearch.xpack.security.Security' - requiresKeystore true - extendedPlugins = ['x-pack-core'] + name 'x-pack-security' + description 'Elasticsearch Expanded Pack Plugin - Security' + classname 'org.elasticsearch.xpack.security.Security' + requiresKeystore true + extendedPlugins = ['x-pack-core'] } archivesBaseName = 'x-pack-security' dependencies { - compileOnly project(path: xpackModule('core'), configuration: 'default') - compileOnly project(path: ':modules:transport-netty4', configuration: 'runtime') - compileOnly project(path: ':plugins:transport-nio', configuration: 'runtime') + compileOnly project(path: xpackModule('core'), configuration: 'default') + compileOnly project(path: ':modules:transport-netty4', configuration: 'runtime') + compileOnly project(path: ':plugins:transport-nio', configuration: 'runtime') - testCompile project(path: xpackModule('monitoring')) - testCompile project(path: xpackModule('sql:sql-action')) + testCompile project(path: xpackModule('monitoring')) + testCompile project(path: xpackModule('sql:sql-action')) - testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') + testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') - compile 'com.unboundid:unboundid-ldapsdk:4.0.8' - compileOnly 'org.bouncycastle:bcprov-jdk15on:1.59' - compileOnly 'org.bouncycastle:bcpkix-jdk15on:1.59' + compile 'com.unboundid:unboundid-ldapsdk:4.0.8' + compileOnly 'org.bouncycastle:bcprov-jdk15on:1.59' + compileOnly 'org.bouncycastle:bcpkix-jdk15on:1.59' - // the following are all SAML dependencies - might as well download the whole internet - compile "org.opensaml:opensaml-core:3.3.0" - compile "org.opensaml:opensaml-saml-api:3.3.0" - compile "org.opensaml:opensaml-saml-impl:3.3.0" - compile "org.opensaml:opensaml-messaging-api:3.3.0" - compile "org.opensaml:opensaml-messaging-impl:3.3.0" - compile "org.opensaml:opensaml-security-api:3.3.0" - compile "org.opensaml:opensaml-security-impl:3.3.0" - compile "org.opensaml:opensaml-profile-api:3.3.0" - compile "org.opensaml:opensaml-profile-impl:3.3.0" - compile "org.opensaml:opensaml-xmlsec-api:3.3.0" - compile "org.opensaml:opensaml-xmlsec-impl:3.3.0" - compile "org.opensaml:opensaml-soap-api:3.3.0" - compile "org.opensaml:opensaml-soap-impl:3.3.0" - compile "org.opensaml:opensaml-storage-api:3.3.0" - compile "org.opensaml:opensaml-storage-impl:3.3.0" - compile "net.shibboleth.utilities:java-support:7.3.0" - compile "org.apache.santuario:xmlsec:2.0.8" - compile "io.dropwizard.metrics:metrics-core:3.2.2" - compile "org.cryptacular:cryptacular:1.2.0" - compile "org.slf4j:slf4j-api:${versions.slf4j}" - compile "org.apache.logging.log4j:log4j-slf4j-impl:${versions.log4j}" - compile "org.apache.httpcomponents:httpclient:${versions.httpclient}" - compile "org.apache.httpcomponents:httpcore:${versions.httpcore}" - compile "org.apache.httpcomponents:httpasyncclient:${versions.httpasyncclient}" - compile "org.apache.httpcomponents:httpcore-nio:${versions.httpcore}" - compile "org.apache.httpcomponents:httpclient-cache:${versions.httpclient}" - compile 'com.google.guava:guava:19.0' + // the following are all SAML dependencies - might as well download the whole internet + compile "org.opensaml:opensaml-core:3.3.0" + compile "org.opensaml:opensaml-saml-api:3.3.0" + compile "org.opensaml:opensaml-saml-impl:3.3.0" + compile "org.opensaml:opensaml-messaging-api:3.3.0" + compile "org.opensaml:opensaml-messaging-impl:3.3.0" + compile "org.opensaml:opensaml-security-api:3.3.0" + compile "org.opensaml:opensaml-security-impl:3.3.0" + compile "org.opensaml:opensaml-profile-api:3.3.0" + compile "org.opensaml:opensaml-profile-impl:3.3.0" + compile "org.opensaml:opensaml-xmlsec-api:3.3.0" + compile "org.opensaml:opensaml-xmlsec-impl:3.3.0" + compile "org.opensaml:opensaml-soap-api:3.3.0" + compile "org.opensaml:opensaml-soap-impl:3.3.0" + compile "org.opensaml:opensaml-storage-api:3.3.0" + compile "org.opensaml:opensaml-storage-impl:3.3.0" + compile "net.shibboleth.utilities:java-support:7.3.0" + compile "org.apache.santuario:xmlsec:2.0.8" + compile "io.dropwizard.metrics:metrics-core:3.2.2" + compile "org.cryptacular:cryptacular:1.2.0" + compile "org.slf4j:slf4j-api:${versions.slf4j}" + compile "org.apache.logging.log4j:log4j-slf4j-impl:${versions.log4j}" + compile "org.apache.httpcomponents:httpclient:${versions.httpclient}" + compile "org.apache.httpcomponents:httpcore:${versions.httpcore}" + compile "org.apache.httpcomponents:httpasyncclient:${versions.httpasyncclient}" + compile "org.apache.httpcomponents:httpcore-nio:${versions.httpcore}" + compile "org.apache.httpcomponents:httpclient-cache:${versions.httpclient}" + compile 'com.google.guava:guava:19.0' - // Dependencies for oidc - compile "com.nimbusds:oauth2-oidc-sdk:6.16.5" - compile "com.nimbusds:nimbus-jose-jwt:8.2" - compile "com.nimbusds:lang-tag:1.4.4" - compile "com.sun.mail:jakarta.mail:1.6.3" - compile "net.jcip:jcip-annotations:1.0" - compile "net.minidev:json-smart:2.3" - compile "net.minidev:accessors-smart:1.2" - compile "org.ow2.asm:asm:7.1" + // Dependencies for oidc + compile "com.nimbusds:oauth2-oidc-sdk:6.16.5" + compile "com.nimbusds:nimbus-jose-jwt:8.2" + compile "com.nimbusds:lang-tag:1.4.4" + compile "com.sun.mail:jakarta.mail:1.6.3" + compile "net.jcip:jcip-annotations:1.0" + compile "net.minidev:json-smart:2.3" + compile "net.minidev:accessors-smart:1.2" + compile "org.ow2.asm:asm:7.1" - testCompile 'org.elasticsearch:securemock:1.2' - testCompile "org.elasticsearch:mocksocket:${versions.mocksocket}" - //testCompile "org.yaml:snakeyaml:${versions.snakeyaml}" + testCompile 'org.elasticsearch:securemock:1.2' + testCompile "org.elasticsearch:mocksocket:${versions.mocksocket}" + //testCompile "org.yaml:snakeyaml:${versions.snakeyaml}" - // Test dependencies for Kerberos (MiniKdc) - testCompile('commons-io:commons-io:2.5') - testCompile('org.apache.kerby:kerb-simplekdc:1.1.1') - testCompile('org.apache.kerby:kerb-client:1.1.1') - testCompile('org.apache.kerby:kerby-config:1.1.1') - testCompile('org.apache.kerby:kerb-core:1.1.1') - testCompile('org.apache.kerby:kerby-pkix:1.1.1') - testCompile('org.apache.kerby:kerby-asn1:1.1.1') - testCompile('org.apache.kerby:kerby-util:1.1.1') - testCompile('org.apache.kerby:kerb-common:1.1.1') - testCompile('org.apache.kerby:kerb-crypto:1.1.1') - testCompile('org.apache.kerby:kerb-util:1.1.1') - testCompile('org.apache.kerby:token-provider:1.1.1') - testCompile('com.nimbusds:nimbus-jose-jwt:8.2') - testCompile('net.jcip:jcip-annotations:1.0') - testCompile('org.apache.kerby:kerb-admin:1.1.1') - testCompile('org.apache.kerby:kerb-server:1.1.1') - testCompile('org.apache.kerby:kerb-identity:1.1.1') - testCompile('org.apache.kerby:kerby-xdr:1.1.1') + // Test dependencies for Kerberos (MiniKdc) + testCompile('commons-io:commons-io:2.5') + testCompile('org.apache.kerby:kerb-simplekdc:1.1.1') + testCompile('org.apache.kerby:kerb-client:1.1.1') + testCompile('org.apache.kerby:kerby-config:1.1.1') + testCompile('org.apache.kerby:kerb-core:1.1.1') + testCompile('org.apache.kerby:kerby-pkix:1.1.1') + testCompile('org.apache.kerby:kerby-asn1:1.1.1') + testCompile('org.apache.kerby:kerby-util:1.1.1') + testCompile('org.apache.kerby:kerb-common:1.1.1') + testCompile('org.apache.kerby:kerb-crypto:1.1.1') + testCompile('org.apache.kerby:kerb-util:1.1.1') + testCompile('org.apache.kerby:token-provider:1.1.1') + testCompile('com.nimbusds:nimbus-jose-jwt:8.2') + testCompile('net.jcip:jcip-annotations:1.0') + testCompile('org.apache.kerby:kerb-admin:1.1.1') + testCompile('org.apache.kerby:kerb-server:1.1.1') + testCompile('org.apache.kerby:kerb-identity:1.1.1') + testCompile('org.apache.kerby:kerby-xdr:1.1.1') - // LDAP backend support for SimpleKdcServer - testCompile('org.apache.kerby:kerby-backend:1.1.1') - testCompile('org.apache.kerby:ldap-backend:1.1.1') - testCompile('org.apache.kerby:kerb-identity:1.1.1') - testCompile('org.apache.directory.api:api-ldap-client-api:1.0.0') - testCompile('org.apache.directory.api:api-ldap-schema-data:1.0.0') - testCompile('org.apache.directory.api:api-ldap-codec-core:1.0.0') - testCompile('org.apache.directory.api:api-ldap-extras-aci:1.0.0') - testCompile('org.apache.directory.api:api-ldap-extras-codec:1.0.0') - testCompile('org.apache.directory.api:api-ldap-extras-codec-api:1.0.0') - testCompile('commons-pool:commons-pool:1.6') - testCompile('commons-collections:commons-collections:3.2') - testCompile('org.apache.mina:mina-core:2.0.17') - testCompile('org.apache.directory.api:api-util:1.0.1') - testCompile('org.apache.directory.api:api-i18n:1.0.1') - testCompile('org.apache.directory.api:api-ldap-model:1.0.1') - testCompile('org.apache.directory.api:api-asn1-api:1.0.1') - testCompile('org.apache.directory.api:api-asn1-ber:1.0.1') - testCompile('org.apache.servicemix.bundles:org.apache.servicemix.bundles.antlr:2.7.7_5') - testCompile('org.apache.directory.server:apacheds-core-api:2.0.0-M24') - testCompile('org.apache.directory.server:apacheds-i18n:2.0.0-M24') - testCompile('org.apache.directory.api:api-ldap-extras-util:1.0.0') - testCompile('net.sf.ehcache:ehcache:2.10.4') - testCompile('org.apache.directory.server:apacheds-kerberos-codec:2.0.0-M24') - testCompile('org.apache.directory.server:apacheds-protocol-ldap:2.0.0-M24') - testCompile('org.apache.directory.server:apacheds-protocol-shared:2.0.0-M24') - testCompile('org.apache.directory.jdbm:apacheds-jdbm1:2.0.0-M3') - testCompile('org.apache.directory.server:apacheds-jdbm-partition:2.0.0-M24') - testCompile('org.apache.directory.server:apacheds-xdbm-partition:2.0.0-M24') - testCompile('org.apache.directory.api:api-ldap-extras-sp:1.0.0') - testCompile('org.apache.directory.server:apacheds-test-framework:2.0.0-M24') - testCompile('org.apache.directory.server:apacheds-core-annotations:2.0.0-M24') - testCompile('org.apache.directory.server:apacheds-ldif-partition:2.0.0-M24') - testCompile('org.apache.directory.server:apacheds-mavibot-partition:2.0.0-M24') - testCompile('org.apache.directory.server:apacheds-protocol-kerberos:2.0.0-M24') - testCompile('org.apache.directory.server:apacheds-server-annotations:2.0.0-M24') - testCompile('org.apache.directory.api:api-ldap-codec-standalone:1.0.0') - testCompile('org.apache.directory.api:api-ldap-net-mina:1.0.0') - testCompile('org.apache.directory.server:ldap-client-test:2.0.0-M24') - testCompile('org.apache.directory.server:apacheds-interceptor-kerberos:2.0.0-M24') - testCompile('org.apache.directory.mavibot:mavibot:1.0.0-M8') + // LDAP backend support for SimpleKdcServer + testCompile('org.apache.kerby:kerby-backend:1.1.1') + testCompile('org.apache.kerby:ldap-backend:1.1.1') + testCompile('org.apache.kerby:kerb-identity:1.1.1') + testCompile('org.apache.directory.api:api-ldap-client-api:1.0.0') + testCompile('org.apache.directory.api:api-ldap-schema-data:1.0.0') + testCompile('org.apache.directory.api:api-ldap-codec-core:1.0.0') + testCompile('org.apache.directory.api:api-ldap-extras-aci:1.0.0') + testCompile('org.apache.directory.api:api-ldap-extras-codec:1.0.0') + testCompile('org.apache.directory.api:api-ldap-extras-codec-api:1.0.0') + testCompile('commons-pool:commons-pool:1.6') + testCompile('commons-collections:commons-collections:3.2') + testCompile('org.apache.mina:mina-core:2.0.17') + testCompile('org.apache.directory.api:api-util:1.0.1') + testCompile('org.apache.directory.api:api-i18n:1.0.1') + testCompile('org.apache.directory.api:api-ldap-model:1.0.1') + testCompile('org.apache.directory.api:api-asn1-api:1.0.1') + testCompile('org.apache.directory.api:api-asn1-ber:1.0.1') + testCompile('org.apache.servicemix.bundles:org.apache.servicemix.bundles.antlr:2.7.7_5') + testCompile('org.apache.directory.server:apacheds-core-api:2.0.0-M24') + testCompile('org.apache.directory.server:apacheds-i18n:2.0.0-M24') + testCompile('org.apache.directory.api:api-ldap-extras-util:1.0.0') + testCompile('net.sf.ehcache:ehcache:2.10.4') + testCompile('org.apache.directory.server:apacheds-kerberos-codec:2.0.0-M24') + testCompile('org.apache.directory.server:apacheds-protocol-ldap:2.0.0-M24') + testCompile('org.apache.directory.server:apacheds-protocol-shared:2.0.0-M24') + testCompile('org.apache.directory.jdbm:apacheds-jdbm1:2.0.0-M3') + testCompile('org.apache.directory.server:apacheds-jdbm-partition:2.0.0-M24') + testCompile('org.apache.directory.server:apacheds-xdbm-partition:2.0.0-M24') + testCompile('org.apache.directory.api:api-ldap-extras-sp:1.0.0') + testCompile('org.apache.directory.server:apacheds-test-framework:2.0.0-M24') + testCompile('org.apache.directory.server:apacheds-core-annotations:2.0.0-M24') + testCompile('org.apache.directory.server:apacheds-ldif-partition:2.0.0-M24') + testCompile('org.apache.directory.server:apacheds-mavibot-partition:2.0.0-M24') + testCompile('org.apache.directory.server:apacheds-protocol-kerberos:2.0.0-M24') + testCompile('org.apache.directory.server:apacheds-server-annotations:2.0.0-M24') + testCompile('org.apache.directory.api:api-ldap-codec-standalone:1.0.0') + testCompile('org.apache.directory.api:api-ldap-net-mina:1.0.0') + testCompile('org.apache.directory.server:ldap-client-test:2.0.0-M24') + testCompile('org.apache.directory.server:apacheds-interceptor-kerberos:2.0.0-M24') + testCompile('org.apache.directory.mavibot:mavibot:1.0.0-M8') } compileJava.options.compilerArgs << "-Xlint:-rawtypes,-unchecked" compileTestJava.options.compilerArgs << "-Xlint:-rawtypes,-unchecked" processTestResources { - from(project(xpackModule('core')).file('src/main/config')) - from(project(xpackModule('core')).file('src/test/resources')) + from(project(xpackModule('core')).file('src/main/config')) + from(project(xpackModule('core')).file('src/test/resources')) } configurations { - testArtifacts.extendsFrom testRuntime + testArtifacts.extendsFrom testRuntime } task testJar(type: Jar) { - appendix 'test' - from sourceSets.test.output + appendix 'test' + from sourceSets.test.output } artifacts { - // normal es plugins do not publish the jar but we need to since users need it for Transport Clients and extensions - archives jar - testArtifacts testJar + // normal es plugins do not publish the jar but we need to since users need it for Transport Clients and extensions + archives jar + testArtifacts testJar } dependencyLicenses { - mapping from: /java-support|opensaml-.*/, to: 'shibboleth' - mapping from: /http.*/, to: 'httpclient' + mapping from: /java-support|opensaml-.*/, to: 'shibboleth' + mapping from: /http.*/, to: 'httpclient' } licenseHeaders { - // This class was sourced from apache directory studio for some microsoft-specific logic - excludes << 'org/elasticsearch/xpack/security/authc/ldap/ActiveDirectorySIDUtil.java' + // This class was sourced from apache directory studio for some microsoft-specific logic + excludes << 'org/elasticsearch/xpack/security/authc/ldap/ActiveDirectorySIDUtil.java' } forbiddenPatterns { - exclude '**/*.key' - exclude '**/*.p12' - exclude '**/*.der' - exclude '**/*.zip' + exclude '**/*.key' + exclude '**/*.p12' + exclude '**/*.der' + exclude '**/*.zip' } forbiddenApisMain { - signaturesFiles += files('forbidden/ldap-signatures.txt', 'forbidden/xml-signatures.txt', 'forbidden/oidc-signatures.txt') + signaturesFiles += files('forbidden/ldap-signatures.txt', 'forbidden/xml-signatures.txt', 'forbidden/oidc-signatures.txt') } // classes are missing, e.g. com.ibm.icu.lang.UCharacter thirdPartyAudit { - ignoreMissingClasses ( - // SAML dependencies - // [missing classes] Some cli utilities that we don't use depend on these missing JCommander classes - 'com.beust.jcommander.JCommander', - 'com.beust.jcommander.converters.BaseConverter', - // [missing classes] Shibboleth + OpenSAML have servlet support that we don't use - 'javax.servlet.AsyncContext', - 'javax.servlet.DispatcherType', - 'javax.servlet.Filter', - 'javax.servlet.FilterChain', - 'javax.servlet.FilterConfig', - 'javax.servlet.RequestDispatcher', - 'javax.servlet.ServletContext', - 'javax.servlet.ServletException', - 'javax.servlet.ServletInputStream', - 'javax.servlet.ServletOutputStream', - 'javax.servlet.ServletRequest', - 'javax.servlet.ServletResponse', - 'javax.servlet.http.Cookie', - 'javax.servlet.http.HttpServletRequest', - 'javax.servlet.http.HttpServletResponse', - 'javax.servlet.http.HttpServletResponseWrapper', - 'javax.servlet.http.HttpSession', - 'javax.servlet.http.Part', - // [missing classes] Shibboleth + OpenSAML have velocity support that we don't use - 'org.apache.velocity.VelocityContext', - 'org.apache.velocity.app.VelocityEngine', - 'org.apache.velocity.context.Context', - 'org.apache.velocity.exception.VelocityException', - 'org.apache.velocity.runtime.RuntimeServices', - 'org.apache.velocity.runtime.log.LogChute', - 'org.apache.velocity.runtime.resource.loader.StringResourceLoader', - 'org.apache.velocity.runtime.resource.util.StringResourceRepository', - // [missing classes] OpenSAML depends on Apache XML security which depends on Xalan, but only for functionality that OpenSAML doesn't use - 'org.apache.xml.dtm.DTM', - 'org.apache.xml.utils.PrefixResolver', - 'org.apache.xml.utils.PrefixResolverDefault', - 'org.apache.xpath.Expression', - 'org.apache.xpath.NodeSetDTM', - 'org.apache.xpath.XPath', - 'org.apache.xpath.XPathContext', - 'org.apache.xpath.compiler.FunctionTable', - 'org.apache.xpath.functions.Function', - 'org.apache.xpath.objects.XNodeSet', - 'org.apache.xpath.objects.XObject', - // [missing classes] OpenSAML storage has an optional LDAP storage impl - 'org.ldaptive.AttributeModification', - 'org.ldaptive.AttributeModificationType', - 'org.ldaptive.Connection', - 'org.ldaptive.DeleteOperation', - 'org.ldaptive.DeleteRequest', - 'org.ldaptive.LdapAttribute', - 'org.ldaptive.LdapEntry', - 'org.ldaptive.LdapException', - 'org.ldaptive.ModifyOperation', - 'org.ldaptive.ModifyRequest', - 'org.ldaptive.Response', - 'org.ldaptive.ResultCode', - 'org.ldaptive.SearchOperation', - 'org.ldaptive.SearchRequest', - 'org.ldaptive.SearchResult', - 'org.ldaptive.ext.MergeOperation', - 'org.ldaptive.ext.MergeRequest', - 'org.ldaptive.pool.ConnectionPool', - 'org.ldaptive.pool.PooledConnectionFactory', - // [missing classes] OpenSAML storage has an optional JSON-backed storage impl - 'javax.json.Json', - 'javax.json.JsonException', - 'javax.json.JsonNumber', - 'javax.json.JsonObject', - 'javax.json.JsonReader', - 'javax.json.JsonValue$ValueType', - 'javax.json.JsonValue', - 'javax.json.stream.JsonGenerator', - // [missing classes] OpenSAML storage has an optional JPA storage impl - 'javax.persistence.EntityManager', - 'javax.persistence.EntityManagerFactory', - 'javax.persistence.EntityTransaction', - 'javax.persistence.LockModeType', - 'javax.persistence.Query', - // [missing classes] OpenSAML storage and HttpClient cache have optional memcache support - 'net.spy.memcached.CASResponse', - 'net.spy.memcached.CASValue', - 'net.spy.memcached.MemcachedClient', - 'net.spy.memcached.MemcachedClientIF', - 'net.spy.memcached.CachedData', - 'net.spy.memcached.internal.OperationFuture', - 'net.spy.memcached.transcoders.Transcoder', - // [missing classes] Http Client cache has optional ehcache support - 'net.sf.ehcache.Ehcache', - 'net.sf.ehcache.Element', - // [missing classes] SLF4j includes an optional class that depends on an extension class (!) - 'org.slf4j.ext.EventData', - // Optional dependency of oauth2-oidc-sdk that we don't need since we do not support AES-SIV for JWE - 'org.cryptomator.siv.SivMode', - // Optional dependency of nimbus-jose-jwt for handling Ed25519 signatures and ECDH with X25519 (RFC 8037) - 'com.google.crypto.tink.subtle.Ed25519Sign', - 'com.google.crypto.tink.subtle.Ed25519Sign$KeyPair', - 'com.google.crypto.tink.subtle.Ed25519Verify', - 'com.google.crypto.tink.subtle.X25519' + ignoreMissingClasses( + // SAML dependencies + // [missing classes] Some cli utilities that we don't use depend on these missing JCommander classes + 'com.beust.jcommander.JCommander', + 'com.beust.jcommander.converters.BaseConverter', + // [missing classes] Shibboleth + OpenSAML have servlet support that we don't use + 'javax.servlet.AsyncContext', + 'javax.servlet.DispatcherType', + 'javax.servlet.Filter', + 'javax.servlet.FilterChain', + 'javax.servlet.FilterConfig', + 'javax.servlet.RequestDispatcher', + 'javax.servlet.ServletContext', + 'javax.servlet.ServletException', + 'javax.servlet.ServletInputStream', + 'javax.servlet.ServletOutputStream', + 'javax.servlet.ServletRequest', + 'javax.servlet.ServletResponse', + 'javax.servlet.http.Cookie', + 'javax.servlet.http.HttpServletRequest', + 'javax.servlet.http.HttpServletResponse', + 'javax.servlet.http.HttpServletResponseWrapper', + 'javax.servlet.http.HttpSession', + 'javax.servlet.http.Part', + // [missing classes] Shibboleth + OpenSAML have velocity support that we don't use + 'org.apache.velocity.VelocityContext', + 'org.apache.velocity.app.VelocityEngine', + 'org.apache.velocity.context.Context', + 'org.apache.velocity.exception.VelocityException', + 'org.apache.velocity.runtime.RuntimeServices', + 'org.apache.velocity.runtime.log.LogChute', + 'org.apache.velocity.runtime.resource.loader.StringResourceLoader', + 'org.apache.velocity.runtime.resource.util.StringResourceRepository', + // [missing classes] OpenSAML depends on Apache XML security which depends on Xalan, but only for functionality that OpenSAML doesn't use + 'org.apache.xml.dtm.DTM', + 'org.apache.xml.utils.PrefixResolver', + 'org.apache.xml.utils.PrefixResolverDefault', + 'org.apache.xpath.Expression', + 'org.apache.xpath.NodeSetDTM', + 'org.apache.xpath.XPath', + 'org.apache.xpath.XPathContext', + 'org.apache.xpath.compiler.FunctionTable', + 'org.apache.xpath.functions.Function', + 'org.apache.xpath.objects.XNodeSet', + 'org.apache.xpath.objects.XObject', + // [missing classes] OpenSAML storage has an optional LDAP storage impl + 'org.ldaptive.AttributeModification', + 'org.ldaptive.AttributeModificationType', + 'org.ldaptive.Connection', + 'org.ldaptive.DeleteOperation', + 'org.ldaptive.DeleteRequest', + 'org.ldaptive.LdapAttribute', + 'org.ldaptive.LdapEntry', + 'org.ldaptive.LdapException', + 'org.ldaptive.ModifyOperation', + 'org.ldaptive.ModifyRequest', + 'org.ldaptive.Response', + 'org.ldaptive.ResultCode', + 'org.ldaptive.SearchOperation', + 'org.ldaptive.SearchRequest', + 'org.ldaptive.SearchResult', + 'org.ldaptive.ext.MergeOperation', + 'org.ldaptive.ext.MergeRequest', + 'org.ldaptive.pool.ConnectionPool', + 'org.ldaptive.pool.PooledConnectionFactory', + // [missing classes] OpenSAML storage has an optional JSON-backed storage impl + 'javax.json.Json', + 'javax.json.JsonException', + 'javax.json.JsonNumber', + 'javax.json.JsonObject', + 'javax.json.JsonReader', + 'javax.json.JsonValue$ValueType', + 'javax.json.JsonValue', + 'javax.json.stream.JsonGenerator', + // [missing classes] OpenSAML storage has an optional JPA storage impl + 'javax.persistence.EntityManager', + 'javax.persistence.EntityManagerFactory', + 'javax.persistence.EntityTransaction', + 'javax.persistence.LockModeType', + 'javax.persistence.Query', + // [missing classes] OpenSAML storage and HttpClient cache have optional memcache support + 'net.spy.memcached.CASResponse', + 'net.spy.memcached.CASValue', + 'net.spy.memcached.MemcachedClient', + 'net.spy.memcached.MemcachedClientIF', + 'net.spy.memcached.CachedData', + 'net.spy.memcached.internal.OperationFuture', + 'net.spy.memcached.transcoders.Transcoder', + // [missing classes] Http Client cache has optional ehcache support + 'net.sf.ehcache.Ehcache', + 'net.sf.ehcache.Element', + // [missing classes] SLF4j includes an optional class that depends on an extension class (!) + 'org.slf4j.ext.EventData', + // Optional dependency of oauth2-oidc-sdk that we don't need since we do not support AES-SIV for JWE + 'org.cryptomator.siv.SivMode', + // Optional dependency of nimbus-jose-jwt for handling Ed25519 signatures and ECDH with X25519 (RFC 8037) + 'com.google.crypto.tink.subtle.Ed25519Sign', + 'com.google.crypto.tink.subtle.Ed25519Sign$KeyPair', + 'com.google.crypto.tink.subtle.Ed25519Verify', + 'com.google.crypto.tink.subtle.X25519' - ) + ) - ignoreViolations ( - // Guava uses internal java api: sun.misc.Unsafe - 'com.google.common.cache.Striped64', - 'com.google.common.cache.Striped64$1', - 'com.google.common.cache.Striped64$Cell', - 'com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator', - 'com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator$1', - 'com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper', - 'com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper$1', - ) + ignoreViolations( + // Guava uses internal java api: sun.misc.Unsafe + 'com.google.common.cache.Striped64', + 'com.google.common.cache.Striped64$1', + 'com.google.common.cache.Striped64$Cell', + 'com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator', + 'com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator$1', + 'com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper', + 'com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper$1', + ) } rootProject.globalInfo.ready { - if (BuildParams.runtimeJavaVersion > JavaVersion.VERSION_1_8) { - thirdPartyAudit.ignoreMissingClasses( - 'javax.xml.bind.JAXBContext', - 'javax.xml.bind.JAXBElement', - 'javax.xml.bind.JAXBException', - 'javax.xml.bind.Unmarshaller', - 'javax.xml.bind.UnmarshallerHandler', - 'javax.activation.ActivationDataFlavor', - 'javax.activation.DataContentHandler', - 'javax.activation.DataHandler', - 'javax.activation.DataSource', - 'javax.activation.FileDataSource', - 'javax.activation.FileTypeMap' - ) - } + if (BuildParams.runtimeJavaVersion > JavaVersion.VERSION_1_8) { + thirdPartyAudit.ignoreMissingClasses( + 'javax.xml.bind.JAXBContext', + 'javax.xml.bind.JAXBElement', + 'javax.xml.bind.JAXBException', + 'javax.xml.bind.Unmarshaller', + 'javax.xml.bind.UnmarshallerHandler', + 'javax.activation.ActivationDataFlavor', + 'javax.activation.DataContentHandler', + 'javax.activation.DataHandler', + 'javax.activation.DataSource', + 'javax.activation.FileDataSource', + 'javax.activation.FileTypeMap' + ) + } } test { - /* - * We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each - * other if we allow them to set the number of available processors as it's set-once in Netty. - */ - systemProperty 'es.set.netty.runtime.available.processors', 'false' + /* + * We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each + * other if we allow them to set the number of available processors as it's set-once in Netty. + */ + systemProperty 'es.set.netty.runtime.available.processors', 'false' - /* - * Some tests in this module set up a lot of transport threads so we reduce the buffer size per transport thread from the 1M default - * to keep direct memory usage under control. - */ - systemProperty 'es.transport.buffer.size', '256k' + /* + * Some tests in this module set up a lot of transport threads so we reduce the buffer size per transport thread from the 1M default + * to keep direct memory usage under control. + */ + systemProperty 'es.transport.buffer.size', '256k' } // xpack modules are installed in real clusters as the meta plugin, so @@ -332,10 +332,10 @@ integTest.enabled = false // add all sub-projects of the qa sub-project gradle.projectsEvaluated { - project.subprojects - .find { it.path == project.path + ":qa" } - .subprojects - .findAll { it.path.startsWith(project.path + ":qa") } - .each { check.dependsOn it.check } + project.subprojects + .find { it.path == project.path + ":qa" } + .subprojects + .findAll { it.path.startsWith(project.path + ":qa") } + .each { check.dependsOn it.check } } diff --git a/x-pack/plugin/security/cli/build.gradle b/x-pack/plugin/security/cli/build.gradle index 8f9776b2165..8957e98b1e3 100644 --- a/x-pack/plugin/security/cli/build.gradle +++ b/x-pack/plugin/security/cli/build.gradle @@ -6,31 +6,31 @@ apply plugin: 'elasticsearch.build' archivesBaseName = 'elasticsearch-security-cli' dependencies { - compileOnly project(":server") - compileOnly project(path: xpackModule('core'), configuration: 'default') - compile "org.bouncycastle:bcpkix-jdk15on:${versions.bouncycastle}" - compile "org.bouncycastle:bcprov-jdk15on:${versions.bouncycastle}" - testImplementation 'com.google.jimfs:jimfs:1.1' - testCompile project(":test:framework") - testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') + compileOnly project(":server") + compileOnly project(path: xpackModule('core'), configuration: 'default') + compile "org.bouncycastle:bcpkix-jdk15on:${versions.bouncycastle}" + compile "org.bouncycastle:bcprov-jdk15on:${versions.bouncycastle}" + testImplementation 'com.google.jimfs:jimfs:1.1' + testCompile project(":test:framework") + testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') } dependencyLicenses { - mapping from: /bc.*/, to: 'bouncycastle' + mapping from: /bc.*/, to: 'bouncycastle' } rootProject.globalInfo.ready { - if (BuildParams.inFipsJvm) { - test.enabled = false - testingConventions.enabled = false - // Forbiden APIs non-portable checks fail because bouncy castle classes being used from the FIPS JDK since those are - // not part of the Java specification - all of this is as designed, so we have to relax this check for FIPS. - tasks.withType(CheckForbiddenApis) { - bundledSignatures -= "jdk-non-portable" - } - // FIPS JVM includes many classes from bouncycastle which count as jar hell for the third party audit, - // rather than provide a long list of exclusions, disable the check on FIPS. - thirdPartyAudit.enabled = false - + if (BuildParams.inFipsJvm) { + test.enabled = false + testingConventions.enabled = false + // Forbiden APIs non-portable checks fail because bouncy castle classes being used from the FIPS JDK since those are + // not part of the Java specification - all of this is as designed, so we have to relax this check for FIPS. + tasks.withType(CheckForbiddenApis) { + bundledSignatures -= "jdk-non-portable" } -} \ No newline at end of file + // FIPS JVM includes many classes from bouncycastle which count as jar hell for the third party audit, + // rather than provide a long list of exclusions, disable the check on FIPS. + thirdPartyAudit.enabled = false + + } +} diff --git a/x-pack/plugin/security/qa/basic-enable-security/build.gradle b/x-pack/plugin/security/qa/basic-enable-security/build.gradle index 18b5ffec414..8ffec1dc6d8 100644 --- a/x-pack/plugin/security/qa/basic-enable-security/build.gradle +++ b/x-pack/plugin/security/qa/basic-enable-security/build.gradle @@ -11,50 +11,50 @@ dependencies { } integTest { - description = "Run tests against a cluster that doesn't have security" - runner { - systemProperty 'tests.has_security', 'false' - } + description = "Run tests against a cluster that doesn't have security" + runner { + systemProperty 'tests.has_security', 'false' + } } testClusters.integTest { - testDistribution = 'DEFAULT' - numberOfNodes = 2 - setting 'xpack.ilm.enabled', 'false' - setting 'xpack.ml.enabled', 'false' - setting 'xpack.license.self_generated.type', 'basic' - setting 'xpack.security.enabled', 'false' + testDistribution = 'DEFAULT' + numberOfNodes = 2 + setting 'xpack.ilm.enabled', 'false' + setting 'xpack.ml.enabled', 'false' + setting 'xpack.license.self_generated.type', 'basic' + setting 'xpack.security.enabled', 'false' } task integTestSecurity(type: RestTestRunnerTask) { - description = "Run tests against a cluster that has security" - useCluster testClusters.integTest - dependsOn integTest - systemProperty 'tests.has_security', 'true' + description = "Run tests against a cluster that has security" + useCluster testClusters.integTest + dependsOn integTest + systemProperty 'tests.has_security', 'true' - doFirst { - testClusters.integTest { - // Reconfigure cluster to enable security - setting 'xpack.security.enabled', 'true' - setting 'xpack.security.authc.anonymous.roles', 'anonymous' - setting 'xpack.security.transport.ssl.enabled', 'true' - setting 'xpack.security.transport.ssl.certificate', 'transport.crt' - setting 'xpack.security.transport.ssl.key', 'transport.key' - setting 'xpack.security.transport.ssl.key_passphrase', 'transport-password' - setting 'xpack.security.transport.ssl.certificate_authorities', 'ca.crt' + doFirst { + testClusters.integTest { + // Reconfigure cluster to enable security + setting 'xpack.security.enabled', 'true' + setting 'xpack.security.authc.anonymous.roles', 'anonymous' + setting 'xpack.security.transport.ssl.enabled', 'true' + setting 'xpack.security.transport.ssl.certificate', 'transport.crt' + setting 'xpack.security.transport.ssl.key', 'transport.key' + setting 'xpack.security.transport.ssl.key_passphrase', 'transport-password' + setting 'xpack.security.transport.ssl.certificate_authorities', 'ca.crt' - extraConfigFile 'transport.key', file('src/test/resources/ssl/transport.key') - extraConfigFile 'transport.crt', file('src/test/resources/ssl/transport.crt') - extraConfigFile 'ca.crt', file('src/test/resources/ssl/ca.crt') - extraConfigFile 'roles.yml', file('src/test/resources/roles.yml') + extraConfigFile 'transport.key', file('src/test/resources/ssl/transport.key') + extraConfigFile 'transport.crt', file('src/test/resources/ssl/transport.crt') + extraConfigFile 'ca.crt', file('src/test/resources/ssl/ca.crt') + extraConfigFile 'roles.yml', file('src/test/resources/roles.yml') - user username: "admin_user", password: "admin-password" - user username: "security_test_user", password: "security-test-password", role: "security_test_role" + user username: "admin_user", password: "admin-password" + user username: "security_test_user", password: "security-test-password", role: "security_test_role" - restart() - } - nonInputProperties.systemProperty 'tests.rest.cluster', "${-> testClusters.integTest.getAllHttpSocketURI().join(",")}" + restart() } + nonInputProperties.systemProperty 'tests.rest.cluster', "${-> testClusters.integTest.getAllHttpSocketURI().join(",")}" + } } check.dependsOn(integTestSecurity) diff --git a/x-pack/plugin/security/qa/build.gradle b/x-pack/plugin/security/qa/build.gradle index 330f5d189d1..46908e1d849 100644 --- a/x-pack/plugin/security/qa/build.gradle +++ b/x-pack/plugin/security/qa/build.gradle @@ -1,11 +1,11 @@ import org.elasticsearch.gradle.test.RestIntegTestTask subprojects { - project.tasks.withType(RestIntegTestTask) { - final File xPackResources = new File(xpackProject('plugin').projectDir, 'src/test/resources') - project.copyRestSpec.from(xPackResources) { - include 'rest-api-spec/api/**' - } + project.tasks.withType(RestIntegTestTask) { + final File xPackResources = new File(xpackProject('plugin').projectDir, 'src/test/resources') + project.copyRestSpec.from(xPackResources) { + include 'rest-api-spec/api/**' } + } } diff --git a/x-pack/plugin/security/qa/tls-basic/build.gradle b/x-pack/plugin/security/qa/tls-basic/build.gradle index 6326a69d4ab..e3b41041612 100644 --- a/x-pack/plugin/security/qa/tls-basic/build.gradle +++ b/x-pack/plugin/security/qa/tls-basic/build.gradle @@ -9,8 +9,8 @@ dependencies { } forbiddenPatterns { - exclude '**/*.key' - exclude '**/*.p12' + exclude '**/*.key' + exclude '**/*.p12' } diff --git a/x-pack/plugin/spatial/build.gradle b/x-pack/plugin/spatial/build.gradle index d6b6cd9f126..aa5f3ff9328 100644 --- a/x-pack/plugin/spatial/build.gradle +++ b/x-pack/plugin/spatial/build.gradle @@ -3,20 +3,20 @@ evaluationDependsOn(xpackModule('core')) apply plugin: 'elasticsearch.esplugin' esplugin { - name 'spatial' - description 'A plugin for Basic Spatial features' - classname 'org.elasticsearch.xpack.spatial.SpatialPlugin' - extendedPlugins = ['x-pack-core'] + name 'spatial' + description 'A plugin for Basic Spatial features' + classname 'org.elasticsearch.xpack.spatial.SpatialPlugin' + extendedPlugins = ['x-pack-core'] } dependencies { - compileOnly project(path: xpackModule('core'), configuration: 'default') - testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') + compileOnly project(path: xpackModule('core'), configuration: 'default') + testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') } licenseHeaders { - // This class was sourced from apache lucene's sandbox module tests - excludes << 'org/apache/lucene/geo/XShapeTestUtil.java' + // This class was sourced from apache lucene's sandbox module tests + excludes << 'org/apache/lucene/geo/XShapeTestUtil.java' } // xpack modules are installed in real clusters as the meta plugin, so diff --git a/x-pack/plugin/sql/build.gradle b/x-pack/plugin/sql/build.gradle index 86ce3d9ddfa..48fd6aee647 100644 --- a/x-pack/plugin/sql/build.gradle +++ b/x-pack/plugin/sql/build.gradle @@ -2,26 +2,26 @@ evaluationDependsOn(xpackModule('core')) apply plugin: 'elasticsearch.esplugin' esplugin { - name 'x-pack-sql' - description 'The Elasticsearch plugin that powers SQL for Elasticsearch' - classname 'org.elasticsearch.xpack.sql.plugin.SqlPlugin' - extendedPlugins = ['x-pack-core', 'lang-painless'] + name 'x-pack-sql' + description 'The Elasticsearch plugin that powers SQL for Elasticsearch' + classname 'org.elasticsearch.xpack.sql.plugin.SqlPlugin' + extendedPlugins = ['x-pack-core', 'lang-painless'] } ext { - // SQL dependency versions - jlineVersion="3.10.0" - antlrVersion="4.5.3" - - // SQL test dependency versions - csvjdbcVersion="1.0.34" - h2Version="1.4.197" - h2gisVersion="1.5.0" + // SQL dependency versions + jlineVersion = "3.10.0" + antlrVersion = "4.5.3" + + // SQL test dependency versions + csvjdbcVersion = "1.0.34" + h2Version = "1.4.197" + h2gisVersion = "1.5.0" } configurations { - // Bundles the sql-cli.jar into the distribution - bin + // Bundles the sql-cli.jar into the distribution + bin } archivesBaseName = 'x-pack-sql' @@ -30,30 +30,30 @@ archivesBaseName = 'x-pack-sql' integTest.enabled = false task internalClusterTest(type: Test) { - mustRunAfter test - include '**/*IT.class' - systemProperty 'es.set.netty.runtime.available.processors', 'false' + mustRunAfter test + include '**/*IT.class' + systemProperty 'es.set.netty.runtime.available.processors', 'false' } check.dependsOn internalClusterTest dependencies { - compileOnly project(path: xpackModule('core'), configuration: 'default') - compileOnly(project(':modules:lang-painless')) { - // exclude ASM to not affect featureAware task on Java 10+ - exclude group: "org.ow2.asm" - } - compile project('sql-action') - compile project(':modules:aggs-matrix-stats') - compile "org.antlr:antlr4-runtime:4.5.3" - testCompile project(':test:framework') - testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') - testCompile project(path: xpackModule('security'), configuration: 'testArtifacts') - testCompile project(path: ':modules:reindex', configuration: 'runtime') - testCompile project(path: ':modules:parent-join', configuration: 'runtime') - testCompile project(path: ':modules:analysis-common', configuration: 'runtime') + compileOnly project(path: xpackModule('core'), configuration: 'default') + compileOnly(project(':modules:lang-painless')) { + // exclude ASM to not affect featureAware task on Java 10+ + exclude group: "org.ow2.asm" + } + compile project('sql-action') + compile project(':modules:aggs-matrix-stats') + compile "org.antlr:antlr4-runtime:4.5.3" + testCompile project(':test:framework') + testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') + testCompile project(path: xpackModule('security'), configuration: 'testArtifacts') + testCompile project(path: ':modules:reindex', configuration: 'runtime') + testCompile project(path: ':modules:parent-join', configuration: 'runtime') + testCompile project(path: ':modules:analysis-common', configuration: 'runtime') - bin(project(path: xpackModule('sql:sql-cli'), configuration: 'shadow')) + bin(project(path: xpackModule('sql:sql-cli'), configuration: 'shadow')) } /* Bundle the sql-cli into the binary files. It should end up @@ -61,18 +61,18 @@ dependencies { * executable jar that can be moved wherever it is needed. */ bundlePlugin { - from (configurations.bin) { - into 'bin' - } + from(configurations.bin) { + into 'bin' + } } // add all sub-projects of the qa sub-project gradle.projectsEvaluated { - project.subprojects - .find { it.path == project.path + ":qa" } - .subprojects - .findAll { it.path.startsWith(project.path + ":qa") } - .each { check.dependsOn it.check } + project.subprojects + .find { it.path == project.path + ":qa" } + .subprojects + .findAll { it.path.startsWith(project.path + ":qa") } + .each { check.dependsOn it.check } } @@ -81,66 +81,66 @@ gradle.projectsEvaluated { **********************************************/ configurations { - regenerate + regenerate } dependencies { - regenerate "org.antlr:antlr4:${antlrVersion}" + regenerate "org.antlr:antlr4:${antlrVersion}" } String grammarPath = 'src/main/antlr' String outputPath = 'src/main/java/org/elasticsearch/xpack/sql/parser' task cleanGenerated(type: Delete) { - delete fileTree(grammarPath) { - include '*.tokens' - } - delete fileTree(outputPath) { - include 'SqlBase*.java' - } + delete fileTree(grammarPath) { + include '*.tokens' + } + delete fileTree(outputPath) { + include 'SqlBase*.java' + } } task regenParser(type: JavaExec) { - dependsOn cleanGenerated - main = 'org.antlr.v4.Tool' - classpath = configurations.regenerate - systemProperty 'file.encoding', 'UTF-8' - systemProperty 'user.language', 'en' - systemProperty 'user.country', 'US' - systemProperty 'user.variant', '' - args '-Werror', - '-package', 'org.elasticsearch.xpack.sql.parser', - '-listener', - '-visitor', - '-o', outputPath, - "${file(grammarPath)}/SqlBase.g4" + dependsOn cleanGenerated + main = 'org.antlr.v4.Tool' + classpath = configurations.regenerate + systemProperty 'file.encoding', 'UTF-8' + systemProperty 'user.language', 'en' + systemProperty 'user.country', 'US' + systemProperty 'user.variant', '' + args '-Werror', + '-package', 'org.elasticsearch.xpack.sql.parser', + '-listener', + '-visitor', + '-o', outputPath, + "${file(grammarPath)}/SqlBase.g4" } task regen { - dependsOn regenParser - doLast { - // moves token files to grammar directory for use with IDE's - ant.move(file: "${outputPath}/SqlBase.tokens", toDir: grammarPath) - ant.move(file: "${outputPath}/SqlBaseLexer.tokens", toDir: grammarPath) - // make the generated classes package private - ant.replaceregexp(match: 'public ((interface|class) \\QSqlBase\\E\\w+)', - replace: '\\1', - encoding: 'UTF-8') { - fileset(dir: outputPath, includes: 'SqlBase*.java') - } - // nuke timestamps/filenames in generated files - ant.replaceregexp(match: '\\Q// Generated from \\E.*', - replace: '\\/\\/ ANTLR GENERATED CODE: DO NOT EDIT', - encoding: 'UTF-8') { - fileset(dir: outputPath, includes: 'SqlBase*.java') - } - // remove tabs in antlr generated files - ant.replaceregexp(match: '\t', flags: 'g', replace: ' ', encoding: 'UTF-8') { - fileset(dir: outputPath, includes: 'SqlBase*.java') - } - // fix line endings - ant.fixcrlf(srcdir: outputPath, eol: 'lf') { - patternset(includes: 'SqlBase*.java') - } + dependsOn regenParser + doLast { + // moves token files to grammar directory for use with IDE's + ant.move(file: "${outputPath}/SqlBase.tokens", toDir: grammarPath) + ant.move(file: "${outputPath}/SqlBaseLexer.tokens", toDir: grammarPath) + // make the generated classes package private + ant.replaceregexp(match: 'public ((interface|class) \\QSqlBase\\E\\w+)', + replace: '\\1', + encoding: 'UTF-8') { + fileset(dir: outputPath, includes: 'SqlBase*.java') } + // nuke timestamps/filenames in generated files + ant.replaceregexp(match: '\\Q// Generated from \\E.*', + replace: '\\/\\/ ANTLR GENERATED CODE: DO NOT EDIT', + encoding: 'UTF-8') { + fileset(dir: outputPath, includes: 'SqlBase*.java') + } + // remove tabs in antlr generated files + ant.replaceregexp(match: '\t', flags: 'g', replace: ' ', encoding: 'UTF-8') { + fileset(dir: outputPath, includes: 'SqlBase*.java') + } + // fix line endings + ant.fixcrlf(srcdir: outputPath, eol: 'lf') { + patternset(includes: 'SqlBase*.java') + } + } } diff --git a/x-pack/plugin/sql/jdbc/build.gradle b/x-pack/plugin/sql/jdbc/build.gradle index b4819a7fd43..7cdec567ef8 100644 --- a/x-pack/plugin/sql/jdbc/build.gradle +++ b/x-pack/plugin/sql/jdbc/build.gradle @@ -7,40 +7,40 @@ description = 'JDBC driver for Elasticsearch' archivesBaseName = "x-pack-sql-jdbc" forbiddenApisMain { - // does not depend on core, so only jdk and http signatures should be checked - replaceSignatureFiles 'jdk-signatures' + // does not depend on core, so only jdk and http signatures should be checked + replaceSignatureFiles 'jdk-signatures' } dependencies { - compile (xpackProject('plugin:sql:sql-client')) { - transitive = false - } - compile (xpackProject('plugin:sql:sql-proto')) { - transitive = false - } - compile (project(':libs:elasticsearch-x-content')) { - transitive = false - } - compile (project(':libs:elasticsearch-geo')) { - transitive = false - } - compile project(':libs:elasticsearch-core') - compile "com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:${versions.jackson}" - runtime "com.fasterxml.jackson.core:jackson-core:${versions.jackson}" - testCompile project(":test:framework") - testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') + compile(xpackProject('plugin:sql:sql-client')) { + transitive = false + } + compile(xpackProject('plugin:sql:sql-proto')) { + transitive = false + } + compile(project(':libs:elasticsearch-x-content')) { + transitive = false + } + compile(project(':libs:elasticsearch-geo')) { + transitive = false + } + compile project(':libs:elasticsearch-core') + compile "com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:${versions.jackson}" + runtime "com.fasterxml.jackson.core:jackson-core:${versions.jackson}" + testCompile project(":test:framework") + testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') } dependencyLicenses { - mapping from: /sql-proto.*/, to: 'elasticsearch' - mapping from: /sql-client.*/, to: 'elasticsearch' - mapping from: /jackson-.*/, to: 'jackson' - mapping from: /elasticsearch-core.*/, to: 'elasticsearch' - ignoreSha 'sql-proto' - ignoreSha 'sql-client' - ignoreSha 'elasticsearch' + mapping from: /sql-proto.*/, to: 'elasticsearch' + mapping from: /sql-client.*/, to: 'elasticsearch' + mapping from: /jackson-.*/, to: 'jackson' + mapping from: /elasticsearch-core.*/, to: 'elasticsearch' + ignoreSha 'sql-proto' + ignoreSha 'sql-client' + ignoreSha 'elasticsearch' } shadowJar { - relocate 'com.fasterxml', 'org.elasticsearch.fasterxml' -} \ No newline at end of file + relocate 'com.fasterxml', 'org.elasticsearch.fasterxml' +} diff --git a/x-pack/plugin/sql/qa/build.gradle b/x-pack/plugin/sql/qa/build.gradle index 18f6c721458..2acbb966776 100644 --- a/x-pack/plugin/sql/qa/build.gradle +++ b/x-pack/plugin/sql/qa/build.gradle @@ -14,9 +14,9 @@ dependencies { // CLI testing dependencies compile project(path: xpackModule('sql:sql-cli')) - + // H2GIS testing dependencies - compile ("org.orbisgis:h2gis:${h2gisVersion}") { + compile("org.orbisgis:h2gis:${h2gisVersion}") { exclude group: "org.locationtech.jts" } @@ -62,7 +62,7 @@ subprojects { resolutionStrategy.force "org.slf4j:slf4j-api:1.7.25" } dependencies { - + /* Since we're a standalone rest test we actually get transitive * dependencies but we don't really want them because they cause * all kinds of trouble with the jar hell checks. So we suppress @@ -77,11 +77,11 @@ subprojects { testRuntime "com.h2database:h2:${h2Version}" // H2GIS testing dependencies - testRuntime ("org.orbisgis:h2gis:${h2gisVersion}") { + testRuntime("org.orbisgis:h2gis:${h2gisVersion}") { exclude group: "org.locationtech.jts" exclude group: "com.fasterxml.jackson.core" } - + testRuntime project(path: xpackModule('sql:jdbc')) testRuntime xpackProject('plugin:sql:sql-client') @@ -92,7 +92,7 @@ subprojects { // CLI testing dependencies testRuntime project(path: xpackModule('sql:sql-cli')) - testRuntime (xpackProject('plugin:sql:sql-action')) { + testRuntime(xpackProject('plugin:sql:sql-action')) { transitive = false } diff --git a/x-pack/plugin/sql/qa/multi-node/build.gradle b/x-pack/plugin/sql/qa/multi-node/build.gradle index 7949f36083a..7e048be414d 100644 --- a/x-pack/plugin/sql/qa/multi-node/build.gradle +++ b/x-pack/plugin/sql/qa/multi-node/build.gradle @@ -6,7 +6,7 @@ description = 'Run a subset of SQL tests against multiple nodes' * feel should need to be tested against more than one node. */ -testClusters.integTest{ +testClusters.integTest { numberOfNodes = 2 setting 'xpack.security.enabled', 'false' setting 'xpack.license.self_generated.type', 'trial' diff --git a/x-pack/plugin/sql/qa/security/build.gradle b/x-pack/plugin/sql/qa/security/build.gradle index 827559e3026..3d77c345723 100644 --- a/x-pack/plugin/sql/qa/security/build.gradle +++ b/x-pack/plugin/sql/qa/security/build.gradle @@ -1,4 +1,3 @@ - dependencies { testCompile project(':x-pack:plugin:core') } @@ -55,9 +54,9 @@ subprojects { testClassesDirs += project.files(testArtifactsDir) classpath += configurations.testArtifacts nonInputProperties.systemProperty 'tests.audit.logfile', - "${ -> testClusters.integTest.singleNode().getAuditLog()}" + "${-> testClusters.integTest.singleNode().getAuditLog()}" nonInputProperties.systemProperty 'tests.audit.yesterday.logfile', - "${ -> testClusters.integTest.singleNode().getAuditLog().getParentFile()}/integTest_audit-${new Date().format('yyyy-MM-dd')}.json" + "${-> testClusters.integTest.singleNode().getAuditLog().getParentFile()}/integTest_audit-${new Date().format('yyyy-MM-dd')}.json" } testingConventions.enabled = false diff --git a/x-pack/plugin/sql/qa/security/with-ssl/build.gradle b/x-pack/plugin/sql/qa/security/with-ssl/build.gradle index 6b6d518b6ca..ef1e6ba4555 100644 --- a/x-pack/plugin/sql/qa/security/with-ssl/build.gradle +++ b/x-pack/plugin/sql/qa/security/with-ssl/build.gradle @@ -35,15 +35,15 @@ task createNodeKeyStore(type: LoggedExec) { executable = "${BuildParams.runtimeJavaHome}/bin/keytool" standardInput = new ByteArrayInputStream('FirstName LastName\nUnit\nOrganization\nCity\nState\nNL\nyes\n\n'.getBytes('UTF-8')) args '-genkey', - '-alias', 'test-node', - '-keystore', nodeKeystore, - '-keyalg', 'RSA', - '-keysize', '2048', - '-validity', '712', - '-dname', 'CN=smoke-test-plugins-ssl', - '-keypass', 'keypass', - '-storepass', 'keypass', - '-ext', san + '-alias', 'test-node', + '-keystore', nodeKeystore, + '-keyalg', 'RSA', + '-keysize', '2048', + '-validity', '712', + '-dname', 'CN=smoke-test-plugins-ssl', + '-keypass', 'keypass', + '-storepass', 'keypass', + '-ext', san } // Generate the client's keystore @@ -60,15 +60,15 @@ task createClientKeyStore(type: LoggedExec) { executable = "${BuildParams.runtimeJavaHome}/bin/keytool" standardInput = new ByteArrayInputStream('FirstName LastName\nUnit\nOrganization\nCity\nState\nNL\nyes\n\n'.getBytes('UTF-8')) args '-genkey', - '-alias', 'test-client', - '-keystore', clientKeyStore, - '-keyalg', 'RSA', - '-keysize', '2048', - '-validity', '712', - '-dname', 'CN=smoke-test-plugins-ssl', - '-keypass', 'keypass', - '-storepass', 'keypass', - '-ext', san + '-alias', 'test-client', + '-keystore', clientKeyStore, + '-keyalg', 'RSA', + '-keysize', '2048', + '-validity', '712', + '-dname', 'CN=smoke-test-plugins-ssl', + '-keypass', 'keypass', + '-storepass', 'keypass', + '-ext', san } // Export the node's certificate @@ -85,10 +85,10 @@ task exportNodeCertificate(type: LoggedExec) { } executable = "${BuildParams.runtimeJavaHome}/bin/keytool" args '-export', - '-alias', 'test-node', - '-keystore', nodeKeystore, - '-storepass', 'keypass', - '-file', nodeCertificate + '-alias', 'test-node', + '-keystore', nodeKeystore, + '-storepass', 'keypass', + '-file', nodeCertificate } // Import the node certificate in the client's keystore @@ -96,11 +96,11 @@ task importNodeCertificateInClientKeyStore(type: LoggedExec) { dependsOn createClientKeyStore, exportNodeCertificate executable = "${BuildParams.runtimeJavaHome}/bin/keytool" args '-import', - '-alias', 'test-node', - '-keystore', clientKeyStore, - '-storepass', 'keypass', - '-file', nodeCertificate, - '-noprompt' + '-alias', 'test-node', + '-keystore', clientKeyStore, + '-storepass', 'keypass', + '-file', nodeCertificate, + '-noprompt' } // Export the client's certificate @@ -117,10 +117,10 @@ task exportClientCertificate(type: LoggedExec) { } executable = "${BuildParams.runtimeJavaHome}/bin/keytool" args '-export', - '-alias', 'test-client', - '-keystore', clientKeyStore, - '-storepass', 'keypass', - '-file', clientCertificate + '-alias', 'test-client', + '-keystore', clientKeyStore, + '-storepass', 'keypass', + '-file', clientCertificate } // Import the client certificate in the node's keystore @@ -128,11 +128,11 @@ task importClientCertificateInNodeKeyStore(type: LoggedExec) { dependsOn createNodeKeyStore, exportClientCertificate executable = "${BuildParams.runtimeJavaHome}/bin/keytool" args '-import', - '-alias', 'test-client', - '-keystore', nodeKeystore, - '-storepass', 'keypass', - '-file', clientCertificate, - '-noprompt' + '-alias', 'test-client', + '-keystore', nodeKeystore, + '-storepass', 'keypass', + '-file', clientCertificate, + '-noprompt' } forbiddenPatterns { @@ -233,7 +233,7 @@ class SanEvaluator { InetAddress address = list.get(i); String hostAddress; if (address instanceof Inet6Address) { - hostAddress = compressedIPV6Address((Inet6Address)address); + hostAddress = compressedIPV6Address((Inet6Address) address); } else { hostAddress = address.getHostAddress(); } diff --git a/x-pack/plugin/sql/sql-action/build.gradle b/x-pack/plugin/sql/sql-action/build.gradle index defbf3dac85..4e74d9be353 100644 --- a/x-pack/plugin/sql/sql-action/build.gradle +++ b/x-pack/plugin/sql/sql-action/build.gradle @@ -1,141 +1,140 @@ - /* * This project contains transport-level requests and responses that are shared between x-pack plugin and qa tests */ apply plugin: 'elasticsearch.build' description = 'Request and response objects shared by the cli, jdbc ' + - 'and the Elasticsearch plugin' + 'and the Elasticsearch plugin' dependencies { - /* We'd like to just depend on xcontent but there are some bits of - * :server that we rely on.... */ - compile (project(':server')) { - transitive = false - } - compile (project(':libs:elasticsearch-core')) { - transitive = false - } - compile (project(':libs:elasticsearch-x-content')) { - transitive = false - } - compile xpackProject('plugin:sql:sql-proto') - compile "org.apache.lucene:lucene-core:${versions.lucene}" - compile "joda-time:joda-time:${versions.joda}" - runtime "com.fasterxml.jackson.core:jackson-core:${versions.jackson}" - runtime "org.apache.logging.log4j:log4j-api:${versions.log4j}" - runtime "org.apache.logging.log4j:log4j-core:${versions.log4j}" + /* We'd like to just depend on xcontent but there are some bits of + * :server that we rely on.... */ + compile(project(':server')) { + transitive = false + } + compile(project(':libs:elasticsearch-core')) { + transitive = false + } + compile(project(':libs:elasticsearch-x-content')) { + transitive = false + } + compile xpackProject('plugin:sql:sql-proto') + compile "org.apache.lucene:lucene-core:${versions.lucene}" + compile "joda-time:joda-time:${versions.joda}" + runtime "com.fasterxml.jackson.core:jackson-core:${versions.jackson}" + runtime "org.apache.logging.log4j:log4j-api:${versions.log4j}" + runtime "org.apache.logging.log4j:log4j-core:${versions.log4j}" - testCompile project(":test:framework") + testCompile project(":test:framework") } forbiddenApisMain { - //sql does not depend on server, so only jdk signatures should be checked - replaceSignatureFiles 'jdk-signatures' + //sql does not depend on server, so only jdk signatures should be checked + replaceSignatureFiles 'jdk-signatures' } dependencyLicenses { - mapping from: /elasticsearch-core.*/, to: 'elasticsearch' - mapping from: /jackson-.*/, to: 'jackson' - mapping from: /lucene-.*/, to: 'lucene' - ignoreSha 'elasticsearch' - ignoreSha 'elasticsearch-core' + mapping from: /elasticsearch-core.*/, to: 'elasticsearch' + mapping from: /jackson-.*/, to: 'jackson' + mapping from: /lucene-.*/, to: 'lucene' + ignoreSha 'elasticsearch' + ignoreSha 'elasticsearch-core' } -thirdPartyAudit.ignoreMissingClasses ( - 'com.fasterxml.jackson.dataformat.yaml.YAMLFactory', - 'com.fasterxml.jackson.dataformat.yaml.YAMLMapper', +thirdPartyAudit.ignoreMissingClasses( + 'com.fasterxml.jackson.dataformat.yaml.YAMLFactory', + 'com.fasterxml.jackson.dataformat.yaml.YAMLMapper', - // from com.fasterxml.jackson.dataformat.yaml.YAMLMapper (jackson-dataformat-yaml) - 'com.fasterxml.jackson.databind.ObjectMapper', - 'org.fusesource.jansi.Ansi', - 'org.fusesource.jansi.AnsiRenderer$Code', + // from com.fasterxml.jackson.dataformat.yaml.YAMLMapper (jackson-dataformat-yaml) + 'com.fasterxml.jackson.databind.ObjectMapper', + 'org.fusesource.jansi.Ansi', + 'org.fusesource.jansi.AnsiRenderer$Code', - // from log4j - 'com.conversantmedia.util.concurrent.DisruptorBlockingQueue', - 'com.conversantmedia.util.concurrent.SpinPolicy', - 'com.fasterxml.jackson.annotation.JsonInclude$Include', - 'com.fasterxml.jackson.databind.DeserializationContext', - 'com.fasterxml.jackson.databind.DeserializationFeature', - 'com.fasterxml.jackson.databind.JsonMappingException', - 'com.fasterxml.jackson.databind.JsonNode', - 'com.fasterxml.jackson.databind.Module$SetupContext', - 'com.fasterxml.jackson.databind.ObjectReader', - 'com.fasterxml.jackson.databind.ObjectWriter', - 'com.fasterxml.jackson.databind.SerializerProvider', - 'com.fasterxml.jackson.databind.deser.std.StdDeserializer', - 'com.fasterxml.jackson.databind.deser.std.StdScalarDeserializer', - 'com.fasterxml.jackson.databind.module.SimpleModule', - 'com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter', - 'com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider', - 'com.fasterxml.jackson.databind.ser.std.StdScalarSerializer', - 'com.fasterxml.jackson.databind.ser.std.StdSerializer', - 'com.fasterxml.jackson.dataformat.xml.JacksonXmlModule', - 'com.fasterxml.jackson.dataformat.xml.XmlMapper', - 'com.fasterxml.jackson.dataformat.xml.util.DefaultXmlPrettyPrinter', - 'com.lmax.disruptor.BlockingWaitStrategy', - 'com.lmax.disruptor.BusySpinWaitStrategy', - 'com.lmax.disruptor.EventFactory', - 'com.lmax.disruptor.EventTranslator', - 'com.lmax.disruptor.EventTranslatorTwoArg', - 'com.lmax.disruptor.EventTranslatorVararg', - 'com.lmax.disruptor.ExceptionHandler', - 'com.lmax.disruptor.LifecycleAware', - 'com.lmax.disruptor.RingBuffer', - 'com.lmax.disruptor.Sequence', - 'com.lmax.disruptor.SequenceReportingEventHandler', - 'com.lmax.disruptor.SleepingWaitStrategy', - 'com.lmax.disruptor.TimeoutBlockingWaitStrategy', - 'com.lmax.disruptor.WaitStrategy', - 'com.lmax.disruptor.YieldingWaitStrategy', - 'com.lmax.disruptor.dsl.Disruptor', - 'com.lmax.disruptor.dsl.ProducerType', - 'javax.jms.Connection', - 'javax.jms.ConnectionFactory', - 'javax.jms.Destination', - 'javax.jms.JMSException', - 'javax.jms.MapMessage', - 'javax.jms.Message', - 'javax.jms.MessageConsumer', - 'javax.jms.MessageProducer', - 'javax.jms.Session', - 'javax.mail.Authenticator', - 'javax.mail.Message$RecipientType', - 'javax.mail.PasswordAuthentication', - 'javax.mail.Session', - 'javax.mail.Transport', - 'javax.mail.internet.InternetAddress', - 'javax.mail.internet.InternetHeaders', - 'javax.mail.internet.MimeBodyPart', - 'javax.mail.internet.MimeMessage', - 'javax.mail.internet.MimeMultipart', - 'javax.mail.internet.MimeUtility', - 'javax.mail.util.ByteArrayDataSource', - 'org.apache.commons.compress.compressors.CompressorStreamFactory', - 'org.apache.commons.compress.utils.IOUtils', - 'org.apache.commons.csv.CSVFormat', - 'org.apache.commons.csv.QuoteMode', - 'org.apache.kafka.clients.producer.Callback', - 'org.apache.kafka.clients.producer.KafkaProducer', - 'org.apache.kafka.clients.producer.Producer', - 'org.apache.kafka.clients.producer.ProducerRecord', - 'org.apache.kafka.clients.producer.RecordMetadata', - 'org.codehaus.stax2.XMLStreamWriter2', - 'org.jctools.queues.MessagePassingQueue$Consumer', - 'org.jctools.queues.MpscArrayQueue', - 'org.osgi.framework.AdaptPermission', - 'org.osgi.framework.AdminPermission', - 'org.osgi.framework.Bundle', - 'org.osgi.framework.BundleActivator', - 'org.osgi.framework.BundleContext', - 'org.osgi.framework.BundleEvent', - 'org.osgi.framework.BundleReference', - 'org.osgi.framework.FrameworkUtil', - 'org.osgi.framework.ServiceRegistration', - 'org.osgi.framework.SynchronousBundleListener', - 'org.osgi.framework.wiring.BundleWire', - 'org.osgi.framework.wiring.BundleWiring', - 'org.zeromq.ZMQ$Context', - 'org.zeromq.ZMQ$Socket', - 'org.zeromq.ZMQ' + // from log4j + 'com.conversantmedia.util.concurrent.DisruptorBlockingQueue', + 'com.conversantmedia.util.concurrent.SpinPolicy', + 'com.fasterxml.jackson.annotation.JsonInclude$Include', + 'com.fasterxml.jackson.databind.DeserializationContext', + 'com.fasterxml.jackson.databind.DeserializationFeature', + 'com.fasterxml.jackson.databind.JsonMappingException', + 'com.fasterxml.jackson.databind.JsonNode', + 'com.fasterxml.jackson.databind.Module$SetupContext', + 'com.fasterxml.jackson.databind.ObjectReader', + 'com.fasterxml.jackson.databind.ObjectWriter', + 'com.fasterxml.jackson.databind.SerializerProvider', + 'com.fasterxml.jackson.databind.deser.std.StdDeserializer', + 'com.fasterxml.jackson.databind.deser.std.StdScalarDeserializer', + 'com.fasterxml.jackson.databind.module.SimpleModule', + 'com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter', + 'com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider', + 'com.fasterxml.jackson.databind.ser.std.StdScalarSerializer', + 'com.fasterxml.jackson.databind.ser.std.StdSerializer', + 'com.fasterxml.jackson.dataformat.xml.JacksonXmlModule', + 'com.fasterxml.jackson.dataformat.xml.XmlMapper', + 'com.fasterxml.jackson.dataformat.xml.util.DefaultXmlPrettyPrinter', + 'com.lmax.disruptor.BlockingWaitStrategy', + 'com.lmax.disruptor.BusySpinWaitStrategy', + 'com.lmax.disruptor.EventFactory', + 'com.lmax.disruptor.EventTranslator', + 'com.lmax.disruptor.EventTranslatorTwoArg', + 'com.lmax.disruptor.EventTranslatorVararg', + 'com.lmax.disruptor.ExceptionHandler', + 'com.lmax.disruptor.LifecycleAware', + 'com.lmax.disruptor.RingBuffer', + 'com.lmax.disruptor.Sequence', + 'com.lmax.disruptor.SequenceReportingEventHandler', + 'com.lmax.disruptor.SleepingWaitStrategy', + 'com.lmax.disruptor.TimeoutBlockingWaitStrategy', + 'com.lmax.disruptor.WaitStrategy', + 'com.lmax.disruptor.YieldingWaitStrategy', + 'com.lmax.disruptor.dsl.Disruptor', + 'com.lmax.disruptor.dsl.ProducerType', + 'javax.jms.Connection', + 'javax.jms.ConnectionFactory', + 'javax.jms.Destination', + 'javax.jms.JMSException', + 'javax.jms.MapMessage', + 'javax.jms.Message', + 'javax.jms.MessageConsumer', + 'javax.jms.MessageProducer', + 'javax.jms.Session', + 'javax.mail.Authenticator', + 'javax.mail.Message$RecipientType', + 'javax.mail.PasswordAuthentication', + 'javax.mail.Session', + 'javax.mail.Transport', + 'javax.mail.internet.InternetAddress', + 'javax.mail.internet.InternetHeaders', + 'javax.mail.internet.MimeBodyPart', + 'javax.mail.internet.MimeMessage', + 'javax.mail.internet.MimeMultipart', + 'javax.mail.internet.MimeUtility', + 'javax.mail.util.ByteArrayDataSource', + 'org.apache.commons.compress.compressors.CompressorStreamFactory', + 'org.apache.commons.compress.utils.IOUtils', + 'org.apache.commons.csv.CSVFormat', + 'org.apache.commons.csv.QuoteMode', + 'org.apache.kafka.clients.producer.Callback', + 'org.apache.kafka.clients.producer.KafkaProducer', + 'org.apache.kafka.clients.producer.Producer', + 'org.apache.kafka.clients.producer.ProducerRecord', + 'org.apache.kafka.clients.producer.RecordMetadata', + 'org.codehaus.stax2.XMLStreamWriter2', + 'org.jctools.queues.MessagePassingQueue$Consumer', + 'org.jctools.queues.MpscArrayQueue', + 'org.osgi.framework.AdaptPermission', + 'org.osgi.framework.AdminPermission', + 'org.osgi.framework.Bundle', + 'org.osgi.framework.BundleActivator', + 'org.osgi.framework.BundleContext', + 'org.osgi.framework.BundleEvent', + 'org.osgi.framework.BundleReference', + 'org.osgi.framework.FrameworkUtil', + 'org.osgi.framework.ServiceRegistration', + 'org.osgi.framework.SynchronousBundleListener', + 'org.osgi.framework.wiring.BundleWire', + 'org.osgi.framework.wiring.BundleWiring', + 'org.zeromq.ZMQ$Context', + 'org.zeromq.ZMQ$Socket', + 'org.zeromq.ZMQ' ) diff --git a/x-pack/plugin/sql/sql-cli/build.gradle b/x-pack/plugin/sql/sql-cli/build.gradle index 0017848d7bb..2b7e4436508 100644 --- a/x-pack/plugin/sql/sql-cli/build.gradle +++ b/x-pack/plugin/sql/sql-cli/build.gradle @@ -17,66 +17,66 @@ archivesBaseName = 'elasticsearch-sql-cli' description = 'Command line interface to Elasticsearch that speaks SQL' dependencies { - - // select just the parts of JLine that are needed - compile "org.jline:jline-terminal:${jlineVersion}" - compile("org.jline:jline-terminal-jna:${jlineVersion}") { - exclude group: "net.java.dev.jna" - } - compile "org.jline:jline-reader:${jlineVersion}" - compile "org.jline:jline-style:${jlineVersion}" - - compile xpackProject('plugin:sql:sql-client') - compile xpackProject('plugin:sql:sql-action') - compile project(":libs:elasticsearch-cli") - compile project(':libs:elasticsearch-x-content') - runtime "org.elasticsearch:jna:${versions.jna}" - testCompile project(":test:framework") + + // select just the parts of JLine that are needed + compile "org.jline:jline-terminal:${jlineVersion}" + compile("org.jline:jline-terminal-jna:${jlineVersion}") { + exclude group: "net.java.dev.jna" + } + compile "org.jline:jline-reader:${jlineVersion}" + compile "org.jline:jline-style:${jlineVersion}" + + compile xpackProject('plugin:sql:sql-client') + compile xpackProject('plugin:sql:sql-action') + compile project(":libs:elasticsearch-cli") + compile project(':libs:elasticsearch-x-content') + runtime "org.elasticsearch:jna:${versions.jna}" + testCompile project(":test:framework") } dependencyLicenses { - mapping from: /elasticsearch-cli.*/, to: 'elasticsearch' - mapping from: /elasticsearch-core.*/, to: 'elasticsearch' - mapping from: /jackson-.*/, to: 'jackson' - mapping from: /lucene-.*/, to: 'lucene' - mapping from: /sql-action.*/, to: 'elasticsearch' - mapping from: /sql-client.*/, to: 'elasticsearch' - mapping from: /jline-.*/, to: 'jline' - ignoreSha 'elasticsearch-cli' - ignoreSha 'elasticsearch-core' - ignoreSha 'elasticsearch' - ignoreSha 'sql-action' - ignoreSha 'sql-client' + mapping from: /elasticsearch-cli.*/, to: 'elasticsearch' + mapping from: /elasticsearch-core.*/, to: 'elasticsearch' + mapping from: /jackson-.*/, to: 'jackson' + mapping from: /lucene-.*/, to: 'lucene' + mapping from: /sql-action.*/, to: 'elasticsearch' + mapping from: /sql-client.*/, to: 'elasticsearch' + mapping from: /jline-.*/, to: 'jline' + ignoreSha 'elasticsearch-cli' + ignoreSha 'elasticsearch-core' + ignoreSha 'elasticsearch' + ignoreSha 'sql-action' + ignoreSha 'sql-client' } shadowJar { - manifest { - attributes 'Main-Class': 'org.elasticsearch.xpack.sql.cli.Cli' - } + manifest { + attributes 'Main-Class': 'org.elasticsearch.xpack.sql.cli.Cli' + } } forbiddenApisMain { - //sql does not depend on server, so only jdk signatures should be checked - replaceSignatureFiles 'jdk-signatures' - signaturesFiles += files('src/forbidden/cli-signatures.txt') + //sql does not depend on server, so only jdk signatures should be checked + replaceSignatureFiles 'jdk-signatures' + signaturesFiles += files('src/forbidden/cli-signatures.txt') } task runcli { - description = 'Run the CLI and connect to elasticsearch running on 9200' - dependsOn shadowJar - doLast { - List command = ["${BuildParams.runtimeJavaHome}/bin/java"] - if ('true'.equals(System.getProperty('debug', 'false'))) { - command += '-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8000' - } - command += ['-jar', shadowJar.archivePath.absolutePath] - logger.info("running the cli with: ${command}") - - new ProcessBuilder(command) - .redirectOutput(ProcessBuilder.Redirect.INHERIT) - .redirectInput(ProcessBuilder.Redirect.INHERIT) - .redirectError(ProcessBuilder.Redirect.INHERIT) - .start() - .waitFor() + description = 'Run the CLI and connect to elasticsearch running on 9200' + dependsOn shadowJar + doLast { + List command = ["${BuildParams.runtimeJavaHome}/bin/java"] + if ('true'.equals(System.getProperty('debug', 'false'))) { + command += '-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8000' } + command += ['-jar', shadowJar.archivePath.absolutePath] + logger.info("running the cli with: ${command}") + + new ProcessBuilder(command) + .redirectOutput(ProcessBuilder.Redirect.INHERIT) + .redirectInput(ProcessBuilder.Redirect.INHERIT) + .redirectError(ProcessBuilder.Redirect.INHERIT) + .start() + .waitFor() + } } diff --git a/x-pack/plugin/sql/sql-client/build.gradle b/x-pack/plugin/sql/sql-client/build.gradle index aac169b044d..071ac6eab84 100644 --- a/x-pack/plugin/sql/sql-client/build.gradle +++ b/x-pack/plugin/sql/sql-client/build.gradle @@ -1,4 +1,3 @@ - /* * The minimal dependencies REST-based SQL client that is used by CLI and JDBC */ @@ -8,43 +7,43 @@ apply plugin: 'elasticsearch.build' description = 'Code shared between jdbc and cli' dependencies { - compile xpackProject('plugin:sql:sql-proto') - compile "com.fasterxml.jackson.core:jackson-core:${versions.jackson}" - testCompile project(":test:framework") - testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') + compile xpackProject('plugin:sql:sql-proto') + compile "com.fasterxml.jackson.core:jackson-core:${versions.jackson}" + testCompile project(":test:framework") + testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') } dependencyLicenses { - mapping from: /jackson-.*/, to: 'jackson' - mapping from: /sql-proto.*/, to: 'elasticsearch' - mapping from: /elasticsearch-cli.*/, to: 'elasticsearch' - mapping from: /elasticsearch-core.*/, to: 'elasticsearch' - ignoreSha 'elasticsearch-core' + mapping from: /jackson-.*/, to: 'jackson' + mapping from: /sql-proto.*/, to: 'elasticsearch' + mapping from: /elasticsearch-cli.*/, to: 'elasticsearch' + mapping from: /elasticsearch-core.*/, to: 'elasticsearch' + ignoreSha 'elasticsearch-core' } forbiddenApisMain { - // does not depend on core, so only jdk and http signatures should be checked - replaceSignatureFiles 'jdk-signatures' + // does not depend on core, so only jdk and http signatures should be checked + replaceSignatureFiles 'jdk-signatures' } forbiddenApisTest { - bundledSignatures -= 'jdk-non-portable' - bundledSignatures += 'jdk-internal' + bundledSignatures -= 'jdk-non-portable' + bundledSignatures += 'jdk-internal' } forbiddenPatterns { - exclude '**/*.keystore' + exclude '**/*.keystore' } // Allow for com.sun.net.httpserver.* usage for testing eclipse { - classpath.file { - whenMerged { cp -> - def con = entries.find { e -> - e.kind == "con" && e.toString().contains("org.eclipse.jdt.launching.JRE_CONTAINER") - } - con.accessRules.add(new org.gradle.plugins.ide.eclipse.model.AccessRule( - "accessible", "com/sun/net/httpserver/*")) - } + classpath.file { + whenMerged { cp -> + def con = entries.find { e -> + e.kind == "con" && e.toString().contains("org.eclipse.jdt.launching.JRE_CONTAINER") + } + con.accessRules.add(new org.gradle.plugins.ide.eclipse.model.AccessRule( + "accessible", "com/sun/net/httpserver/*")) } + } } diff --git a/x-pack/plugin/sql/sql-proto/build.gradle b/x-pack/plugin/sql/sql-proto/build.gradle index af890d82968..dac036ecf6b 100644 --- a/x-pack/plugin/sql/sql-proto/build.gradle +++ b/x-pack/plugin/sql/sql-proto/build.gradle @@ -1,31 +1,30 @@ - /* * This project contains XContent protocol classes shared between server and http client */ apply plugin: 'elasticsearch.build' description = 'Request and response objects shared by the cli, jdbc ' + - 'and the Elasticsearch plugin' + 'and the Elasticsearch plugin' dependencies { - compile (project(':libs:elasticsearch-core')) { - transitive = false - } - compile (project(':libs:elasticsearch-x-content')) { - transitive = false - } - runtime "com.fasterxml.jackson.core:jackson-core:${versions.jackson}" + compile(project(':libs:elasticsearch-core')) { + transitive = false + } + compile(project(':libs:elasticsearch-x-content')) { + transitive = false + } + runtime "com.fasterxml.jackson.core:jackson-core:${versions.jackson}" - testCompile project(":test:framework") + testCompile project(":test:framework") } forbiddenApisMain { - //sql does not depend on server, so only jdk signatures should be checked - replaceSignatureFiles 'jdk-signatures' + //sql does not depend on server, so only jdk signatures should be checked + replaceSignatureFiles 'jdk-signatures' } dependencyLicenses { - mapping from: /elasticsearch-core.*/, to: 'elasticsearch' - mapping from: /jackson-.*/, to: 'jackson' - ignoreSha 'elasticsearch-core' + mapping from: /elasticsearch-core.*/, to: 'elasticsearch' + mapping from: /jackson-.*/, to: 'jackson' + ignoreSha 'elasticsearch-core' } diff --git a/x-pack/plugin/transform/build.gradle b/x-pack/plugin/transform/build.gradle index 28824750480..8dfe7f2567f 100644 --- a/x-pack/plugin/transform/build.gradle +++ b/x-pack/plugin/transform/build.gradle @@ -9,10 +9,10 @@ esplugin { } dependencies { - compileOnly project(":server") + compileOnly project(":server") - compileOnly project(path: xpackModule('core'), configuration: 'default') - testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') + compileOnly project(path: xpackModule('core'), configuration: 'default') + testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') } // xpack modules are installed in real clusters as the meta plugin, so @@ -22,9 +22,9 @@ integTest.enabled = false // add all sub-projects of the qa sub-project gradle.projectsEvaluated { - project.subprojects - .find { it.path == project.path + ":qa" } - .subprojects - .findAll { it.path.startsWith(project.path + ":qa") } - .each { check.dependsOn it.check } + project.subprojects + .find { it.path == project.path + ":qa" } + .subprojects + .findAll { it.path.startsWith(project.path + ":qa") } + .each { check.dependsOn it.check } } diff --git a/x-pack/plugin/transform/qa/multi-node-tests/build.gradle b/x-pack/plugin/transform/qa/multi-node-tests/build.gradle index cec942efa84..652a7a1abe3 100644 --- a/x-pack/plugin/transform/qa/multi-node-tests/build.gradle +++ b/x-pack/plugin/transform/qa/multi-node-tests/build.gradle @@ -15,10 +15,10 @@ File nodeKey = file("$keystoreDir/testnode.pem") File nodeCert = file("$keystoreDir/testnode.crt") // Add key and certs to test classpath: it expects it there task copyKeyCerts(type: Copy) { - from(project(':x-pack:plugin:core').file('src/test/resources/org/elasticsearch/xpack/security/transport/ssl/certs/simple/')) { - include 'testnode.crt', 'testnode.pem' - } - into keystoreDir + from(project(':x-pack:plugin:core').file('src/test/resources/org/elasticsearch/xpack/security/transport/ssl/certs/simple/')) { + include 'testnode.crt', 'testnode.pem' + } + into keystoreDir } // Add keys and cets to test classpath: it expects it there sourceSets.test.resources.srcDir(keystoreDir) diff --git a/x-pack/plugin/vectors/build.gradle b/x-pack/plugin/vectors/build.gradle index 96c8af48d49..26c1549859c 100644 --- a/x-pack/plugin/vectors/build.gradle +++ b/x-pack/plugin/vectors/build.gradle @@ -3,17 +3,17 @@ evaluationDependsOn(xpackModule('core')) apply plugin: 'elasticsearch.esplugin' esplugin { - name 'vectors' - description 'A plugin for working with vectors' - classname 'org.elasticsearch.xpack.vectors.Vectors' - extendedPlugins = ['x-pack-core', 'lang-painless'] + name 'vectors' + description 'A plugin for working with vectors' + classname 'org.elasticsearch.xpack.vectors.Vectors' + extendedPlugins = ['x-pack-core', 'lang-painless'] } archivesBaseName = 'x-pack-vectors' dependencies { - compileOnly project(':modules:lang-painless:spi') - compileOnly project(path: xpackModule('core'), configuration: 'default') - testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') + compileOnly project(':modules:lang-painless:spi') + compileOnly project(path: xpackModule('core'), configuration: 'default') + testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') } integTest.enabled = false diff --git a/x-pack/plugin/voting-only-node/build.gradle b/x-pack/plugin/voting-only-node/build.gradle index 4401201e414..7fbf027c47f 100644 --- a/x-pack/plugin/voting-only-node/build.gradle +++ b/x-pack/plugin/voting-only-node/build.gradle @@ -2,18 +2,18 @@ evaluationDependsOn(xpackModule('core')) apply plugin: 'elasticsearch.esplugin' esplugin { - name 'x-pack-voting-only-node' - description 'Elasticsearch Expanded Pack Plugin - Voting-only node' - classname 'org.elasticsearch.cluster.coordination.VotingOnlyNodePlugin' - extendedPlugins = ['x-pack-core'] + name 'x-pack-voting-only-node' + description 'Elasticsearch Expanded Pack Plugin - Voting-only node' + classname 'org.elasticsearch.cluster.coordination.VotingOnlyNodePlugin' + extendedPlugins = ['x-pack-core'] } dependencies { - compileOnly project(path: xpackModule('core'), configuration: 'default') - testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') + compileOnly project(path: xpackModule('core'), configuration: 'default') + testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') } // xpack modules are installed in real clusters as the meta plugin, so // installing them as individual plugins for integ tests doesn't make sense, // so we disable integ tests -integTest.enabled = false \ No newline at end of file +integTest.enabled = false diff --git a/x-pack/plugin/watcher/build.gradle b/x-pack/plugin/watcher/build.gradle index fc891b30e5a..9754cf79ae9 100644 --- a/x-pack/plugin/watcher/build.gradle +++ b/x-pack/plugin/watcher/build.gradle @@ -20,44 +20,64 @@ compileJava.options.compilerArgs << "-Xlint:-rawtypes,-unchecked" compileTestJava.options.compilerArgs << "-Xlint:-rawtypes,-unchecked" dependencyLicenses { - mapping from: /owasp-java-html-sanitizer.*/, to: 'owasp-java-html-sanitizer' - ignoreSha 'x-pack-core' + mapping from: /owasp-java-html-sanitizer.*/, to: 'owasp-java-html-sanitizer' + ignoreSha 'x-pack-core' } dependencies { - compileOnly project(':server') - compileOnly project(path: xpackModule('core'), configuration: 'default') - compileOnly project(path: ':modules:transport-netty4', configuration: 'runtime') - compileOnly project(path: ':plugins:transport-nio', configuration: 'runtime') + compileOnly project(':server') + compileOnly project(path: xpackModule('core'), configuration: 'default') + compileOnly project(path: ':modules:transport-netty4', configuration: 'runtime') + compileOnly project(path: ':plugins:transport-nio', configuration: 'runtime') - testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') - testCompile project(xpackModule('ilm')) + testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') + testCompile project(xpackModule('ilm')) - // watcher deps - compile 'com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer:r239' - compile 'com.google.guava:guava:16.0.1' // needed by watcher for the html sanitizer - compile 'com.sun.mail:jakarta.mail:1.6.4' - compile 'com.sun.activation:jakarta.activation:1.2.1' - compileOnly "org.apache.httpcomponents:httpclient:${versions.httpclient}" - compileOnly "org.apache.httpcomponents:httpcore:${versions.httpcore}" + // watcher deps + compile 'com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer:r239' + compile 'com.google.guava:guava:16.0.1' // needed by watcher for the html sanitizer + compile 'com.sun.mail:jakarta.mail:1.6.4' + compile 'com.sun.activation:jakarta.activation:1.2.1' + compileOnly "org.apache.httpcomponents:httpclient:${versions.httpclient}" + compileOnly "org.apache.httpcomponents:httpcore:${versions.httpcore}" - testCompile 'org.subethamail:subethasmtp:3.1.7' - // needed for subethasmtp, has @GuardedBy annotation - testCompile 'com.google.code.findbugs:jsr305:3.0.2' + testCompile 'org.subethamail:subethasmtp:3.1.7' + // needed for subethasmtp, has @GuardedBy annotation + testCompile 'com.google.code.findbugs:jsr305:3.0.2' } // classes are missing, e.g. com.ibm.icu.lang.UCharacter -thirdPartyAudit { - ignoreViolations ( - // uses internal java api: sun.misc.Unsafe - 'com.google.common.cache.Striped64', - 'com.google.common.cache.Striped64$1', - 'com.google.common.cache.Striped64$Cell', - 'com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator', - 'com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator$1' - ) +thirdPartyAudit { + ignoreViolations( + // uses internal java api: sun.misc.Unsafe + 'com.google.common.cache.Striped64', + 'com.google.common.cache.Striped64$1', + 'com.google.common.cache.Striped64$Cell', + 'com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator', + 'com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator$1' + ) - ignoreViolations( + ignoreViolations( + 'com.sun.activation.registries.LineTokenizer', + 'com.sun.activation.registries.LogSupport', + 'com.sun.activation.registries.MailcapFile', + 'com.sun.activation.registries.MailcapTokenizer', + 'com.sun.activation.registries.MimeTypeEntry', + 'com.sun.activation.registries.MimeTypeFile', + 'javax.activation.MailcapCommandMap', + 'javax.activation.MimetypesFileTypeMap' + ) +} + +forbiddenPatterns { + exclude '**/*.p12' +} + +// pulled in as external dependency to work on java 9 +rootProject.globalInfo.ready { + if (BuildParams.runtimeJavaVersion <= JavaVersion.VERSION_1_8) { + thirdPartyAudit.ignoreJarHellWithJDK( + // pulled in as external dependency to work on java 9 'com.sun.activation.registries.LineTokenizer', 'com.sun.activation.registries.LogSupport', 'com.sun.activation.registries.MailcapFile', @@ -65,64 +85,44 @@ thirdPartyAudit { 'com.sun.activation.registries.MimeTypeEntry', 'com.sun.activation.registries.MimeTypeFile', 'javax.activation.MailcapCommandMap', - 'javax.activation.MimetypesFileTypeMap' + 'javax.activation.MimetypesFileTypeMap', + + 'com.sun.activation.registries.MailcapParseException', + 'javax.activation.ActivationDataFlavor', + 'javax.activation.CommandInfo', + 'javax.activation.CommandMap', + 'javax.activation.CommandObject', + 'javax.activation.DataContentHandler', + 'javax.activation.DataContentHandlerFactory', + 'javax.activation.DataHandler$1', + 'javax.activation.DataHandler', + 'javax.activation.DataHandlerDataSource', + 'javax.activation.DataSource', + 'javax.activation.DataSourceDataContentHandler', + 'javax.activation.FileDataSource', + 'javax.activation.FileTypeMap', + 'javax.activation.MimeType', + 'javax.activation.MimeTypeParameterList', + 'javax.activation.MimeTypeParseException', + 'javax.activation.ObjectDataContentHandler', + 'javax.activation.SecuritySupport$1', + 'javax.activation.SecuritySupport$2', + 'javax.activation.SecuritySupport$3', + 'javax.activation.SecuritySupport$4', + 'javax.activation.SecuritySupport$5', + 'javax.activation.SecuritySupport', + 'javax.activation.URLDataSource', + 'javax.activation.UnsupportedDataTypeException' ) -} - -forbiddenPatterns { - exclude '**/*.p12' -} - -// pulled in as external dependency to work on java 9 -rootProject.globalInfo.ready { - if (BuildParams.runtimeJavaVersion <= JavaVersion.VERSION_1_8) { - thirdPartyAudit.ignoreJarHellWithJDK( - // pulled in as external dependency to work on java 9 - 'com.sun.activation.registries.LineTokenizer', - 'com.sun.activation.registries.LogSupport', - 'com.sun.activation.registries.MailcapFile', - 'com.sun.activation.registries.MailcapTokenizer', - 'com.sun.activation.registries.MimeTypeEntry', - 'com.sun.activation.registries.MimeTypeFile', - 'javax.activation.MailcapCommandMap', - 'javax.activation.MimetypesFileTypeMap', - - 'com.sun.activation.registries.MailcapParseException', - 'javax.activation.ActivationDataFlavor', - 'javax.activation.CommandInfo', - 'javax.activation.CommandMap', - 'javax.activation.CommandObject', - 'javax.activation.DataContentHandler', - 'javax.activation.DataContentHandlerFactory', - 'javax.activation.DataHandler$1', - 'javax.activation.DataHandler', - 'javax.activation.DataHandlerDataSource', - 'javax.activation.DataSource', - 'javax.activation.DataSourceDataContentHandler', - 'javax.activation.FileDataSource', - 'javax.activation.FileTypeMap', - 'javax.activation.MimeType', - 'javax.activation.MimeTypeParameterList', - 'javax.activation.MimeTypeParseException', - 'javax.activation.ObjectDataContentHandler', - 'javax.activation.SecuritySupport$1', - 'javax.activation.SecuritySupport$2', - 'javax.activation.SecuritySupport$3', - 'javax.activation.SecuritySupport$4', - 'javax.activation.SecuritySupport$5', - 'javax.activation.SecuritySupport', - 'javax.activation.URLDataSource', - 'javax.activation.UnsupportedDataTypeException' - ) - } + } } test { - /* - * We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each - * other if we allow them to set the number of available processors as it's set-once in Netty. - */ - systemProperty 'es.set.netty.runtime.available.processors', 'false' + /* + * We have to disable setting the number of available processors as tests in the same JVM randomize processors and will step on each + * other if we allow them to set the number of available processors as it's set-once in Netty. + */ + systemProperty 'es.set.netty.runtime.available.processors', 'false' } // xpack modules are installed in real clusters as the meta plugin, so diff --git a/x-pack/qa/core-rest-tests-with-security/build.gradle b/x-pack/qa/core-rest-tests-with-security/build.gradle index 19bb678abd4..f273efaf5bc 100644 --- a/x-pack/qa/core-rest-tests-with-security/build.gradle +++ b/x-pack/qa/core-rest-tests-with-security/build.gradle @@ -10,10 +10,10 @@ integTest { includePackaged = true runner { systemProperty 'tests.rest.blacklist', - [ - 'index/10_with_id/Index with ID', - 'indices.get_alias/10_basic/Get alias against closed indices' - ].join(',') + [ + 'index/10_with_id/Index with ID', + 'indices.get_alias/10_basic/Get alias against closed indices' + ].join(',') systemProperty 'tests.rest.cluster.username', System.getProperty('tests.rest.cluster.username', 'test_user') systemProperty 'tests.rest.cluster.password', System.getProperty('tests.rest.cluster.password', 'x-pack-test-password') @@ -30,5 +30,5 @@ testClusters.integTest { setting 'xpack.license.self_generated.type', 'trial' user username: System.getProperty('tests.rest.cluster.username', 'test_user'), - password: System.getProperty('tests.rest.cluster.password', 'x-pack-test-password') + password: System.getProperty('tests.rest.cluster.password', 'x-pack-test-password') } diff --git a/x-pack/qa/evil-tests/build.gradle b/x-pack/qa/evil-tests/build.gradle index d411909fb31..a785dd4e496 100644 --- a/x-pack/qa/evil-tests/build.gradle +++ b/x-pack/qa/evil-tests/build.gradle @@ -1,11 +1,11 @@ apply plugin: 'elasticsearch.standalone-test' dependencies { - testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') - testCompile project(path: xpackModule('security'), configuration: 'testArtifacts') + testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') + testCompile project(path: xpackModule('security'), configuration: 'testArtifacts') } test { - systemProperty 'tests.security.manager', 'false' - include '**/*Tests.class' + systemProperty 'tests.security.manager', 'false' + include '**/*Tests.class' } diff --git a/x-pack/qa/full-cluster-restart/build.gradle b/x-pack/qa/full-cluster-restart/build.gradle index 07c4f2f9363..c04e41c5be8 100644 --- a/x-pack/qa/full-cluster-restart/build.gradle +++ b/x-pack/qa/full-cluster-restart/build.gradle @@ -7,138 +7,138 @@ apply plugin: 'elasticsearch.testclusters' apply plugin: 'elasticsearch.standalone-test' dependencies { - // TODO: Remove core dependency and change tests to not use builders that are part of xpack-core. - // Currently needed for ml tests are using the building for datafeed and job config) - testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') + // TODO: Remove core dependency and change tests to not use builders that are part of xpack-core. + // Currently needed for ml tests are using the building for datafeed and job config) + testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') - testCompile project(path: ':qa:full-cluster-restart', configuration: 'testArtifacts') - testCompile project(':x-pack:qa') + testCompile project(path: ':qa:full-cluster-restart', configuration: 'testArtifacts') + testCompile project(':x-pack:qa') } licenseHeaders { - approvedLicenses << 'Apache' + approvedLicenses << 'Apache' } forbiddenPatterns { - exclude '**/system_key' + exclude '**/system_key' } String outputDir = "${buildDir}/generated-resources/${project.name}" tasks.register("bwcTest") { - description = 'Runs backwards compatibility tests.' - group = 'verification' + description = 'Runs backwards compatibility tests.' + group = 'verification' } tasks.register("copyTestNodeKeyMaterial", Copy) { - from project(':x-pack:plugin:core') - .files( - 'src/test/resources/org/elasticsearch/xpack/security/transport/ssl/certs/simple/testnode.pem', - 'src/test/resources/org/elasticsearch/xpack/security/transport/ssl/certs/simple/testnode.crt' - ) - into outputDir + from project(':x-pack:plugin:core') + .files( + 'src/test/resources/org/elasticsearch/xpack/security/transport/ssl/certs/simple/testnode.pem', + 'src/test/resources/org/elasticsearch/xpack/security/transport/ssl/certs/simple/testnode.crt' + ) + into outputDir } configurations { - restSpec + restSpec } dependencies { - restSpec project(':rest-api-spec') + restSpec project(':rest-api-spec') } processTestResources { - dependsOn configurations.restSpec - from ({ zipTree(configurations.restSpec.singleFile) }) { - include 'rest-api-spec/api/**' - } - from (project(xpackModule('core')).sourceSets.test.resources) { - include 'rest-api-spec/api/**' - } + dependsOn configurations.restSpec + from({ zipTree(configurations.restSpec.singleFile) }) { + include 'rest-api-spec/api/**' + } + from(project(xpackModule('core')).sourceSets.test.resources) { + include 'rest-api-spec/api/**' + } } for (Version bwcVersion : bwcVersions.indexCompatible) { - String baseName = "v${bwcVersion}" + String baseName = "v${bwcVersion}" - testClusters { - "${baseName}" { - testDistribution = "DEFAULT" - versions = [bwcVersion.toString(), project.version] - numberOfNodes = 2 - setting 'path.repo', "${buildDir}/cluster/shared/repo/${baseName}" - javaHome = BuildParams.runtimeJavaHome - user username: "test_user", password: "x-pack-test-password" + testClusters { + "${baseName}" { + testDistribution = "DEFAULT" + versions = [bwcVersion.toString(), project.version] + numberOfNodes = 2 + setting 'path.repo', "${buildDir}/cluster/shared/repo/${baseName}" + javaHome = BuildParams.runtimeJavaHome + user username: "test_user", password: "x-pack-test-password" - setting 'path.repo', "${buildDir}/cluster/shared/repo/${baseName}" - // some tests rely on the translog not being flushed - setting 'indices.memory.shard_inactive_time', '20m' - setting 'xpack.security.enabled', 'true' - setting 'xpack.security.transport.ssl.enabled', 'true' - setting 'xpack.license.self_generated.type', 'trial' + setting 'path.repo', "${buildDir}/cluster/shared/repo/${baseName}" + // some tests rely on the translog not being flushed + setting 'indices.memory.shard_inactive_time', '20m' + setting 'xpack.security.enabled', 'true' + setting 'xpack.security.transport.ssl.enabled', 'true' + setting 'xpack.license.self_generated.type', 'trial' - extraConfigFile 'testnode.pem', file("${outputDir}/testnode.pem") - extraConfigFile 'testnode.crt', file("${outputDir}/testnode.crt") + extraConfigFile 'testnode.pem', file("${outputDir}/testnode.pem") + extraConfigFile 'testnode.crt', file("${outputDir}/testnode.crt") - keystore 'xpack.watcher.encryption_key', file("${project.projectDir}/src/test/resources/system_key") - setting 'xpack.watcher.encrypt_sensitive_data', 'true' + keystore 'xpack.watcher.encryption_key', file("${project.projectDir}/src/test/resources/system_key") + setting 'xpack.watcher.encrypt_sensitive_data', 'true' - setting 'xpack.security.transport.ssl.key', 'testnode.pem' - setting 'xpack.security.transport.ssl.certificate', 'testnode.crt' - keystore 'xpack.security.transport.ssl.secure_key_passphrase', 'testnode' - } + setting 'xpack.security.transport.ssl.key', 'testnode.pem' + setting 'xpack.security.transport.ssl.certificate', 'testnode.crt' + keystore 'xpack.security.transport.ssl.secure_key_passphrase', 'testnode' } + } - tasks.register("${baseName}#oldClusterTest", RestTestRunnerTask) { - mustRunAfter(precommit) - useCluster testClusters."${baseName}" - dependsOn copyTestNodeKeyMaterial - doFirst { - project.delete("${buildDir}/cluster/shared/repo/${baseName}") - } - systemProperty 'tests.is_old_cluster', 'true' - systemProperty 'tests.old_cluster_version', version.toString().minus("-SNAPSHOT") - exclude 'org/elasticsearch/upgrades/FullClusterRestartIT.class' - exclude 'org/elasticsearch/upgrades/FullClusterRestartSettingsUpgradeIT.class' - exclude 'org/elasticsearch/upgrades/QueryBuilderBWCIT.class' + tasks.register("${baseName}#oldClusterTest", RestTestRunnerTask) { + mustRunAfter(precommit) + useCluster testClusters."${baseName}" + dependsOn copyTestNodeKeyMaterial + doFirst { + project.delete("${buildDir}/cluster/shared/repo/${baseName}") } + systemProperty 'tests.is_old_cluster', 'true' + systemProperty 'tests.old_cluster_version', version.toString().minus("-SNAPSHOT") + exclude 'org/elasticsearch/upgrades/FullClusterRestartIT.class' + exclude 'org/elasticsearch/upgrades/FullClusterRestartSettingsUpgradeIT.class' + exclude 'org/elasticsearch/upgrades/QueryBuilderBWCIT.class' + } - tasks.register("${baseName}#upgradedClusterTest", RestTestRunnerTask) { - mustRunAfter(precommit) - useCluster testClusters."${baseName}" - dependsOn "${baseName}#oldClusterTest" - doFirst { - testClusters."${baseName}".goToNextVersion() - } - systemProperty 'tests.is_old_cluster', 'false' - systemProperty 'tests.old_cluster_version', version.toString().minus("-SNAPSHOT") - exclude 'org/elasticsearch/upgrades/FullClusterRestartIT.class' - exclude 'org/elasticsearch/upgrades/FullClusterRestartSettingsUpgradeIT.class' - exclude 'org/elasticsearch/upgrades/QueryBuilderBWCIT.class' + tasks.register("${baseName}#upgradedClusterTest", RestTestRunnerTask) { + mustRunAfter(precommit) + useCluster testClusters."${baseName}" + dependsOn "${baseName}#oldClusterTest" + doFirst { + testClusters."${baseName}".goToNextVersion() } + systemProperty 'tests.is_old_cluster', 'false' + systemProperty 'tests.old_cluster_version', version.toString().minus("-SNAPSHOT") + exclude 'org/elasticsearch/upgrades/FullClusterRestartIT.class' + exclude 'org/elasticsearch/upgrades/FullClusterRestartSettingsUpgradeIT.class' + exclude 'org/elasticsearch/upgrades/QueryBuilderBWCIT.class' + } - tasks.matching { it.name.startsWith(baseName) && it.name.endsWith("ClusterTest") }.configureEach { - it.systemProperty 'tests.old_cluster_version', bwcVersion.toString().minus("-SNAPSHOT") - it.systemProperty 'tests.path.repo', "${buildDir}/cluster/shared/repo/${baseName}" - it.nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",") }") - it.nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName() }") - } + tasks.matching { it.name.startsWith(baseName) && it.name.endsWith("ClusterTest") }.configureEach { + it.systemProperty 'tests.old_cluster_version', bwcVersion.toString().minus("-SNAPSHOT") + it.systemProperty 'tests.path.repo', "${buildDir}/cluster/shared/repo/${baseName}" + it.nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",")}") + it.nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName()}") + } - tasks.register("${baseName}#bwcTest") { - dependsOn "${baseName}#upgradedClusterTest" - } + tasks.register("${baseName}#bwcTest") { + dependsOn "${baseName}#upgradedClusterTest" + } - if (project.bwc_tests_enabled) { - bwcTest.dependsOn("${baseName}#bwcTest") - } + if (project.bwc_tests_enabled) { + bwcTest.dependsOn("${baseName}#bwcTest") + } } task bwcTestSnapshots { - if (project.bwc_tests_enabled) { - for (final def version : bwcVersions.unreleasedIndexCompatible) { - dependsOn "v${version}#bwcTest" - } + if (project.bwc_tests_enabled) { + for (final def version : bwcVersions.unreleasedIndexCompatible) { + dependsOn "v${version}#bwcTest" } + } } check.dependsOn(bwcTestSnapshots) diff --git a/x-pack/qa/kerberos-tests/build.gradle b/x-pack/qa/kerberos-tests/build.gradle index 3b6530a69d8..430db18427a 100644 --- a/x-pack/qa/kerberos-tests/build.gradle +++ b/x-pack/qa/kerberos-tests/build.gradle @@ -9,55 +9,55 @@ apply plugin: 'elasticsearch.test.fixtures' testFixtures.useFixture ":test:fixtures:krb5kdc-fixture", "peppa" dependencies { - testCompile project(':x-pack:plugin:core') - testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') - testCompile project(path: xpackModule('security'), configuration: 'testArtifacts') + testCompile project(':x-pack:plugin:core') + testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') + testCompile project(path: xpackModule('security'), configuration: 'testArtifacts') } testClusters.integTest { - testDistribution = 'DEFAULT' - // force localhost IPv4 otherwise it is a chicken and egg problem where we need the keytab for the hostname when starting the cluster - // but do not know the exact address that is first in the http ports file - setting 'http.host', '127.0.0.1' - setting 'xpack.license.self_generated.type', 'trial' - setting 'xpack.security.enabled', 'true' - setting 'xpack.security.authc.realms.file.file1.order', '0' - setting 'xpack.ml.enabled', 'false' - setting 'xpack.security.audit.enabled', 'true' - setting 'xpack.security.authc.token.enabled', 'true' - // Kerberos realm - setting 'xpack.security.authc.realms.kerberos.kerberos.order', '1' - setting 'xpack.security.authc.realms.kerberos.kerberos.keytab.path', 'es.keytab' - setting 'xpack.security.authc.realms.kerberos.kerberos.krb.debug', 'true' - setting 'xpack.security.authc.realms.kerberos.kerberos.remove_realm_name', 'false' + testDistribution = 'DEFAULT' + // force localhost IPv4 otherwise it is a chicken and egg problem where we need the keytab for the hostname when starting the cluster + // but do not know the exact address that is first in the http ports file + setting 'http.host', '127.0.0.1' + setting 'xpack.license.self_generated.type', 'trial' + setting 'xpack.security.enabled', 'true' + setting 'xpack.security.authc.realms.file.file1.order', '0' + setting 'xpack.ml.enabled', 'false' + setting 'xpack.security.audit.enabled', 'true' + setting 'xpack.security.authc.token.enabled', 'true' + // Kerberos realm + setting 'xpack.security.authc.realms.kerberos.kerberos.order', '1' + setting 'xpack.security.authc.realms.kerberos.kerberos.keytab.path', 'es.keytab' + setting 'xpack.security.authc.realms.kerberos.kerberos.krb.debug', 'true' + setting 'xpack.security.authc.realms.kerberos.kerberos.remove_realm_name', 'false' - systemProperty "java.security.krb5.conf", { project(':test:fixtures:krb5kdc-fixture').ext.krb5Conf("peppa").toString() } - systemProperty "sun.security.krb5.debug", "true" + systemProperty "java.security.krb5.conf", { project(':test:fixtures:krb5kdc-fixture').ext.krb5Conf("peppa").toString() } + systemProperty "sun.security.krb5.debug", "true" - extraConfigFile "es.keytab", project(':test:fixtures:krb5kdc-fixture').ext.krb5Keytabs("peppa", "HTTP_localhost.keytab") + extraConfigFile "es.keytab", project(':test:fixtures:krb5kdc-fixture').ext.krb5Keytabs("peppa", "HTTP_localhost.keytab") - user username: "test_admin", password: "x-pack-test-password" - user username: "test_kibana_user", password: "x-pack-test-password", role: "kibana_system" + user username: "test_admin", password: "x-pack-test-password" + user username: "test_kibana_user", password: "x-pack-test-password", role: "kibana_system" } task copyKeytabToGeneratedResources(type: Copy) { - from project(':test:fixtures:krb5kdc-fixture').ext.krb5Keytabs("peppa", "peppa.keytab") - into "$buildDir/generated-resources/keytabs" - dependsOn project(':test:fixtures:krb5kdc-fixture').postProcessFixture + from project(':test:fixtures:krb5kdc-fixture').ext.krb5Keytabs("peppa", "peppa.keytab") + into "$buildDir/generated-resources/keytabs" + dependsOn project(':test:fixtures:krb5kdc-fixture').postProcessFixture } String realm = "BUILD.ELASTIC.CO" integTest.runner { - Path peppaKeytab = Paths.get("${project.buildDir}", "generated-resources", "keytabs", "peppa.keytab") - nonInputProperties.systemProperty 'test.userkt', "peppa@${realm}" - nonInputProperties.systemProperty 'test.userkt.keytab', "${peppaKeytab}" - nonInputProperties.systemProperty 'test.userpwd', "george@${realm}" - systemProperty 'test.userpwd.password', "dino" - systemProperty 'tests.security.manager', 'true' - jvmArgs([ - "-Djava.security.krb5.conf=${project(':test:fixtures:krb5kdc-fixture').ext.krb5Conf("peppa")}", - "-Dsun.security.krb5.debug=true" - ]) - classpath += copyKeytabToGeneratedResources.outputs.files + Path peppaKeytab = Paths.get("${project.buildDir}", "generated-resources", "keytabs", "peppa.keytab") + nonInputProperties.systemProperty 'test.userkt', "peppa@${realm}" + nonInputProperties.systemProperty 'test.userkt.keytab', "${peppaKeytab}" + nonInputProperties.systemProperty 'test.userpwd', "george@${realm}" + systemProperty 'test.userpwd.password', "dino" + systemProperty 'tests.security.manager', 'true' + jvmArgs([ + "-Djava.security.krb5.conf=${project(':test:fixtures:krb5kdc-fixture').ext.krb5Conf("peppa")}", + "-Dsun.security.krb5.debug=true" + ]) + classpath += copyKeytabToGeneratedResources.outputs.files } diff --git a/x-pack/qa/oidc-op-tests/build.gradle b/x-pack/qa/oidc-op-tests/build.gradle index 13f2ef4927d..204a6a33244 100644 --- a/x-pack/qa/oidc-op-tests/build.gradle +++ b/x-pack/qa/oidc-op-tests/build.gradle @@ -6,20 +6,20 @@ apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.test.fixtures' dependencies { - testCompile project(path: xpackModule('core'), configuration: 'default') - testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') - testCompile project(path: xpackModule('security'), configuration: 'testArtifacts') + testCompile project(path: xpackModule('core'), configuration: 'default') + testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') + testCompile project(path: xpackModule('security'), configuration: 'testArtifacts') } testFixtures.useFixture ":x-pack:test:idp-fixture", "oidc-provider" String ephemeralPort; task setupPorts { - // Don't attempt to get ephemeral ports when Docker is not available - onlyIf { idpFixtureProject.postProcessFixture.enabled } - dependsOn idpFixtureProject.postProcessFixture - doLast { - ephemeralPort = idpFixtureProject.postProcessFixture.ext."test.fixtures.oidc-provider.tcp.8080" - } + // Don't attempt to get ephemeral ports when Docker is not available + onlyIf { idpFixtureProject.postProcessFixture.enabled } + dependsOn idpFixtureProject.postProcessFixture + doLast { + ephemeralPort = idpFixtureProject.postProcessFixture.ext."test.fixtures.oidc-provider.tcp.8080" + } } integTest.runner { @@ -27,48 +27,48 @@ integTest.runner { } testClusters.integTest { - testDistribution = 'DEFAULT' - setting 'xpack.license.self_generated.type', 'trial' - setting 'xpack.security.enabled', 'true' - setting 'xpack.security.http.ssl.enabled', 'false' - setting 'xpack.security.authc.token.enabled', 'true' - setting 'xpack.security.authc.realms.file.file.order', '0' - setting 'xpack.security.authc.realms.native.native.order', '1' - // OpenID Connect Realm 1 configured for authorization grant flow - setting 'xpack.security.authc.realms.oidc.c2id.order', '2' - setting 'xpack.security.authc.realms.oidc.c2id.op.issuer', 'http://localhost:8080' - setting 'xpack.security.authc.realms.oidc.c2id.op.authorization_endpoint', { "http://127.0.0.1:${ephemeralPort}/c2id-login" } - setting 'xpack.security.authc.realms.oidc.c2id.op.token_endpoint', { "http://127.0.0.1:${ephemeralPort}/c2id/token" } - setting 'xpack.security.authc.realms.oidc.c2id.op.userinfo_endpoint', { "http://127.0.0.1:${ephemeralPort}/c2id/userinfo" } - setting 'xpack.security.authc.realms.oidc.c2id.op.jwkset_path', 'op-jwks.json' - setting 'xpack.security.authc.realms.oidc.c2id.rp.redirect_uri', 'https://my.fantastic.rp/cb' - setting 'xpack.security.authc.realms.oidc.c2id.rp.client_id', 'https://my.elasticsearch.org/rp' - keystore 'xpack.security.authc.realms.oidc.c2id.rp.client_secret', 'b07efb7a1cf6ec9462afe7b6d3ab55c6c7880262aa61ac28dded292aca47c9a2' - setting 'xpack.security.authc.realms.oidc.c2id.rp.response_type', 'code' - setting 'xpack.security.authc.realms.oidc.c2id.claims.principal', 'sub' - setting 'xpack.security.authc.realms.oidc.c2id.claims.name', 'name' - setting 'xpack.security.authc.realms.oidc.c2id.claims.mail', 'email' - setting 'xpack.security.authc.realms.oidc.c2id.claims.groups', 'groups' - // OpenID Connect Realm 2 configured for implicit flow - setting 'xpack.security.authc.realms.oidc.c2id-implicit.order', '3' - setting 'xpack.security.authc.realms.oidc.c2id-implicit.op.issuer', 'http://localhost:8080' - setting 'xpack.security.authc.realms.oidc.c2id-implicit.op.authorization_endpoint', { "http://127.0.0.1:${ephemeralPort}/c2id-login" } - setting 'xpack.security.authc.realms.oidc.c2id-implicit.op.token_endpoint', { "http://127.0.0.1:${ephemeralPort}/c2id/token" } - setting 'xpack.security.authc.realms.oidc.c2id-implicit.op.userinfo_endpoint', { "http://127.0.0.1:${ephemeralPort}/c2id/userinfo" } - setting 'xpack.security.authc.realms.oidc.c2id-implicit.op.jwkset_path', 'op-jwks.json' - setting 'xpack.security.authc.realms.oidc.c2id-implicit.rp.redirect_uri', 'https://my.fantastic.rp/cb' - setting 'xpack.security.authc.realms.oidc.c2id-implicit.rp.client_id', 'elasticsearch-rp' - keystore 'xpack.security.authc.realms.oidc.c2id-implicit.rp.client_secret', 'b07efb7a1cf6ec9462afe7b6d3ab55c6c7880262aa61ac28dded292aca47c9a2' - setting 'xpack.security.authc.realms.oidc.c2id-implicit.rp.response_type', 'id_token token' - setting 'xpack.security.authc.realms.oidc.c2id-implicit.claims.principal', 'sub' - setting 'xpack.security.authc.realms.oidc.c2id-implicit.claims.name', 'name' - setting 'xpack.security.authc.realms.oidc.c2id-implicit.claims.mail', 'email' - setting 'xpack.security.authc.realms.oidc.c2id-implicit.claims.groups', 'groups' - setting 'xpack.ml.enabled', 'false' - - extraConfigFile 'op-jwks.json', idpFixtureProject.file("oidc/op-jwks.json") + testDistribution = 'DEFAULT' + setting 'xpack.license.self_generated.type', 'trial' + setting 'xpack.security.enabled', 'true' + setting 'xpack.security.http.ssl.enabled', 'false' + setting 'xpack.security.authc.token.enabled', 'true' + setting 'xpack.security.authc.realms.file.file.order', '0' + setting 'xpack.security.authc.realms.native.native.order', '1' + // OpenID Connect Realm 1 configured for authorization grant flow + setting 'xpack.security.authc.realms.oidc.c2id.order', '2' + setting 'xpack.security.authc.realms.oidc.c2id.op.issuer', 'http://localhost:8080' + setting 'xpack.security.authc.realms.oidc.c2id.op.authorization_endpoint', { "http://127.0.0.1:${ephemeralPort}/c2id-login" } + setting 'xpack.security.authc.realms.oidc.c2id.op.token_endpoint', { "http://127.0.0.1:${ephemeralPort}/c2id/token" } + setting 'xpack.security.authc.realms.oidc.c2id.op.userinfo_endpoint', { "http://127.0.0.1:${ephemeralPort}/c2id/userinfo" } + setting 'xpack.security.authc.realms.oidc.c2id.op.jwkset_path', 'op-jwks.json' + setting 'xpack.security.authc.realms.oidc.c2id.rp.redirect_uri', 'https://my.fantastic.rp/cb' + setting 'xpack.security.authc.realms.oidc.c2id.rp.client_id', 'https://my.elasticsearch.org/rp' + keystore 'xpack.security.authc.realms.oidc.c2id.rp.client_secret', 'b07efb7a1cf6ec9462afe7b6d3ab55c6c7880262aa61ac28dded292aca47c9a2' + setting 'xpack.security.authc.realms.oidc.c2id.rp.response_type', 'code' + setting 'xpack.security.authc.realms.oidc.c2id.claims.principal', 'sub' + setting 'xpack.security.authc.realms.oidc.c2id.claims.name', 'name' + setting 'xpack.security.authc.realms.oidc.c2id.claims.mail', 'email' + setting 'xpack.security.authc.realms.oidc.c2id.claims.groups', 'groups' + // OpenID Connect Realm 2 configured for implicit flow + setting 'xpack.security.authc.realms.oidc.c2id-implicit.order', '3' + setting 'xpack.security.authc.realms.oidc.c2id-implicit.op.issuer', 'http://localhost:8080' + setting 'xpack.security.authc.realms.oidc.c2id-implicit.op.authorization_endpoint', { "http://127.0.0.1:${ephemeralPort}/c2id-login" } + setting 'xpack.security.authc.realms.oidc.c2id-implicit.op.token_endpoint', { "http://127.0.0.1:${ephemeralPort}/c2id/token" } + setting 'xpack.security.authc.realms.oidc.c2id-implicit.op.userinfo_endpoint', { "http://127.0.0.1:${ephemeralPort}/c2id/userinfo" } + setting 'xpack.security.authc.realms.oidc.c2id-implicit.op.jwkset_path', 'op-jwks.json' + setting 'xpack.security.authc.realms.oidc.c2id-implicit.rp.redirect_uri', 'https://my.fantastic.rp/cb' + setting 'xpack.security.authc.realms.oidc.c2id-implicit.rp.client_id', 'elasticsearch-rp' + keystore 'xpack.security.authc.realms.oidc.c2id-implicit.rp.client_secret', 'b07efb7a1cf6ec9462afe7b6d3ab55c6c7880262aa61ac28dded292aca47c9a2' + setting 'xpack.security.authc.realms.oidc.c2id-implicit.rp.response_type', 'id_token token' + setting 'xpack.security.authc.realms.oidc.c2id-implicit.claims.principal', 'sub' + setting 'xpack.security.authc.realms.oidc.c2id-implicit.claims.name', 'name' + setting 'xpack.security.authc.realms.oidc.c2id-implicit.claims.mail', 'email' + setting 'xpack.security.authc.realms.oidc.c2id-implicit.claims.groups', 'groups' + setting 'xpack.ml.enabled', 'false' - user username: "test_admin", password: "x-pack-test-password" + extraConfigFile 'op-jwks.json', idpFixtureProject.file("oidc/op-jwks.json") + + user username: "test_admin", password: "x-pack-test-password" } -thirdPartyAudit.enabled = false \ No newline at end of file +thirdPartyAudit.enabled = false diff --git a/x-pack/qa/openldap-tests/build.gradle b/x-pack/qa/openldap-tests/build.gradle index 805023b5413..9bd0e669838 100644 --- a/x-pack/qa/openldap-tests/build.gradle +++ b/x-pack/qa/openldap-tests/build.gradle @@ -2,9 +2,9 @@ apply plugin: 'elasticsearch.standalone-test' apply plugin: 'elasticsearch.test.fixtures' dependencies { - testCompile project(path: xpackModule('core'), configuration: 'default') - testCompile project(path: xpackModule('security'), configuration: 'testArtifacts') - testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') + testCompile project(path: xpackModule('core'), configuration: 'default') + testCompile project(path: xpackModule('security'), configuration: 'testArtifacts') + testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') } testFixtures.useFixture ":x-pack:test:idp-fixture", "openldap" @@ -12,8 +12,8 @@ testFixtures.useFixture ":x-pack:test:idp-fixture", "openldap" Project idpFixtureProject = xpackProject("test:idp-fixture") String outputDir = "${project.buildDir}/generated-resources/${project.name}" task copyIdpTrust(type: Copy) { - from idpFixtureProject.file('openldap/certs/ca.jks'); - from idpFixtureProject.file('openldap/certs/ca_server.pem'); - into outputDir + from idpFixtureProject.file('openldap/certs/ca.jks'); + from idpFixtureProject.file('openldap/certs/ca_server.pem'); + into outputDir } project.sourceSets.test.output.dir(outputDir, builtBy: copyIdpTrust) diff --git a/x-pack/qa/reindex-tests-with-security/build.gradle b/x-pack/qa/reindex-tests-with-security/build.gradle index 4a29494084e..58ab5515b14 100644 --- a/x-pack/qa/reindex-tests-with-security/build.gradle +++ b/x-pack/qa/reindex-tests-with-security/build.gradle @@ -12,10 +12,10 @@ dependencies { } forbiddenPatterns { - exclude '**/*.key' - exclude '**/*.pem' - exclude '**/*.p12' - exclude '**/*.jks' + exclude '**/*.key' + exclude '**/*.pem' + exclude '**/*.p12' + exclude '**/*.jks' } File caFile = project.file('src/test/resources/ssl/ca.p12') diff --git a/x-pack/qa/rolling-upgrade-basic/build.gradle b/x-pack/qa/rolling-upgrade-basic/build.gradle index 2bf41aeaa89..2c4b2364ef7 100644 --- a/x-pack/qa/rolling-upgrade-basic/build.gradle +++ b/x-pack/qa/rolling-upgrade-basic/build.gradle @@ -6,118 +6,118 @@ apply plugin: 'elasticsearch.testclusters' apply plugin: 'elasticsearch.standalone-test' dependencies { - testCompile project(':x-pack:qa') + testCompile project(':x-pack:qa') } tasks.register("bwcTest") { - description = 'Runs backwards compatibility tests.' - group = 'verification' + description = 'Runs backwards compatibility tests.' + group = 'verification' } configurations { - restSpec + restSpec } dependencies { - restSpec project(':rest-api-spec') + restSpec project(':rest-api-spec') } processTestResources { - dependsOn configurations.restSpec - from ({ zipTree(configurations.restSpec.singleFile) }) { - include 'rest-api-spec/api/**' - } - from (project(xpackProject('plugin').path).sourceSets.test.resources) { - include 'rest-api-spec/api/**' - } + dependsOn configurations.restSpec + from({ zipTree(configurations.restSpec.singleFile) }) { + include 'rest-api-spec/api/**' + } + from(project(xpackProject('plugin').path).sourceSets.test.resources) { + include 'rest-api-spec/api/**' + } } for (Version bwcVersion : bwcVersions.wireCompatible) { - String baseName = "v${bwcVersion}" + String baseName = "v${bwcVersion}" - testClusters { - "${baseName}" { - testDistribution = "DEFAULT" - versions = [bwcVersion.toString(), project.version] - numberOfNodes = 3 + testClusters { + "${baseName}" { + testDistribution = "DEFAULT" + versions = [bwcVersion.toString(), project.version] + numberOfNodes = 3 - setting 'repositories.url.allowed_urls', 'http://snapshot.test*' - setting 'xpack.security.enabled', 'false' - setting 'xpack.monitoring.enabled', 'false' - setting 'xpack.ml.enabled', 'false' - setting 'xpack.watcher.enabled', 'false' - setting 'xpack.license.self_generated.type', 'basic' - javaHome = BuildParams.runtimeJavaHome - } + setting 'repositories.url.allowed_urls', 'http://snapshot.test*' + setting 'xpack.security.enabled', 'false' + setting 'xpack.monitoring.enabled', 'false' + setting 'xpack.ml.enabled', 'false' + setting 'xpack.watcher.enabled', 'false' + setting 'xpack.license.self_generated.type', 'basic' + javaHome = BuildParams.runtimeJavaHome } + } - tasks.register("${baseName}#oldClusterTest", RestTestRunnerTask) { - useCluster testClusters."${baseName}" - mustRunAfter(precommit) - systemProperty 'tests.rest.suite', 'old_cluster' - systemProperty 'tests.upgrade_from_version', version.toString().replace('-SNAPSHOT', '') - nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",") }") - nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName() }") + tasks.register("${baseName}#oldClusterTest", RestTestRunnerTask) { + useCluster testClusters."${baseName}" + mustRunAfter(precommit) + systemProperty 'tests.rest.suite', 'old_cluster' + systemProperty 'tests.upgrade_from_version', version.toString().replace('-SNAPSHOT', '') + nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",")}") + nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName()}") + } + + + tasks.register("${baseName}#oneThirdUpgradedTest", RestTestRunnerTask) { + dependsOn "${baseName}#oldClusterTest" + useCluster testClusters."${baseName}" + doFirst { + testClusters."${baseName}".nextNodeToNextVersion() } + nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",")}") + nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName()}") + systemProperty 'tests.rest.suite', 'mixed_cluster' + systemProperty 'tests.first_round', 'true' + systemProperty 'tests.upgrade_from_version', bwcVersion.toString().replace('-SNAPSHOT', '') + } - - tasks.register("${baseName}#oneThirdUpgradedTest", RestTestRunnerTask) { - dependsOn "${baseName}#oldClusterTest" - useCluster testClusters."${baseName}" - doFirst { - testClusters."${baseName}".nextNodeToNextVersion() - } - nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",")}") - nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName()}") - systemProperty 'tests.rest.suite', 'mixed_cluster' - systemProperty 'tests.first_round', 'true' - systemProperty 'tests.upgrade_from_version', bwcVersion.toString().replace('-SNAPSHOT', '') + tasks.register("${baseName}#twoThirdsUpgradedTest", RestTestRunnerTask) { + dependsOn "${baseName}#oneThirdUpgradedTest" + useCluster testClusters."${baseName}" + doFirst { + testClusters."${baseName}".nextNodeToNextVersion() } + nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",")}") + nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName()}") + systemProperty 'tests.rest.suite', 'mixed_cluster' + systemProperty 'tests.first_round', 'false' + systemProperty 'tests.upgrade_from_version', bwcVersion.toString().replace('-SNAPSHOT', '') + } - tasks.register("${baseName}#twoThirdsUpgradedTest", RestTestRunnerTask) { - dependsOn "${baseName}#oneThirdUpgradedTest" - useCluster testClusters."${baseName}" - doFirst { - testClusters."${baseName}".nextNodeToNextVersion() - } - nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",") }") - nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName() }") - systemProperty 'tests.rest.suite', 'mixed_cluster' - systemProperty 'tests.first_round', 'false' - systemProperty 'tests.upgrade_from_version', bwcVersion.toString().replace('-SNAPSHOT', '') + tasks.register("${baseName}#upgradedClusterTest", RestTestRunnerTask) { + dependsOn "${baseName}#twoThirdsUpgradedTest" + useCluster testClusters."${baseName}" + doFirst { + testClusters."${baseName}".nextNodeToNextVersion() } + nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",")}") + nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName()}") + systemProperty 'tests.rest.suite', 'upgraded_cluster' + systemProperty 'tests.upgrade_from_version', bwcVersion.toString().replace('-SNAPSHOT', '') + } - tasks.register("${baseName}#upgradedClusterTest", RestTestRunnerTask) { - dependsOn "${baseName}#twoThirdsUpgradedTest" - useCluster testClusters."${baseName}" - doFirst { - testClusters."${baseName}".nextNodeToNextVersion() - } - nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",") }") - nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName() }") - systemProperty 'tests.rest.suite', 'upgraded_cluster' - systemProperty 'tests.upgrade_from_version', bwcVersion.toString().replace('-SNAPSHOT', '') - } + tasks.register("${baseName}#bwcTest") { + dependsOn "${baseName}#upgradedClusterTest" + } - tasks.register("${baseName}#bwcTest") { - dependsOn "${baseName}#upgradedClusterTest" - } - - if (project.bwc_tests_enabled) { - bwcTest.dependsOn("${baseName}#bwcTest") - } + if (project.bwc_tests_enabled) { + bwcTest.dependsOn("${baseName}#bwcTest") + } } task bwcTestSnapshots { - if (project.bwc_tests_enabled) { - for (final def version : bwcVersions.unreleasedWireCompatible) { - dependsOn "v${version}#bwcTest" - } + if (project.bwc_tests_enabled) { + for (final def version : bwcVersions.unreleasedWireCompatible) { + dependsOn "v${version}#bwcTest" } + } } check.dependsOn(bwcTestSnapshots) compileTestJava.options.compilerArgs << "-Xlint:-cast,-rawtypes,-unchecked" -test.enabled = false \ No newline at end of file +test.enabled = false diff --git a/x-pack/qa/rolling-upgrade-multi-cluster/build.gradle b/x-pack/qa/rolling-upgrade-multi-cluster/build.gradle index c5ec5907bc4..641d9a13ff7 100644 --- a/x-pack/qa/rolling-upgrade-multi-cluster/build.gradle +++ b/x-pack/qa/rolling-upgrade-multi-cluster/build.gradle @@ -6,131 +6,131 @@ apply plugin: 'elasticsearch.testclusters' apply plugin: 'elasticsearch.standalone-test' dependencies { - testCompile project(':x-pack:qa') + testCompile project(':x-pack:qa') } tasks.register("bwcTest") { - description = 'Runs backwards compatibility tests.' - group = 'verification' + description = 'Runs backwards compatibility tests.' + group = 'verification' } configurations { - restSpec + restSpec } dependencies { - restSpec project(':rest-api-spec') + restSpec project(':rest-api-spec') } processTestResources { - dependsOn configurations.restSpec - from ({ zipTree(configurations.restSpec.singleFile) }) { - include 'rest-api-spec/api/**' - } - from (project(xpackProject('plugin').path).sourceSets.test.resources) { - include 'rest-api-spec/api/**' - } + dependsOn configurations.restSpec + from({ zipTree(configurations.restSpec.singleFile) }) { + include 'rest-api-spec/api/**' + } + from(project(xpackProject('plugin').path).sourceSets.test.resources) { + include 'rest-api-spec/api/**' + } } for (Version bwcVersion : bwcVersions.wireCompatible) { - String baseName = "v${bwcVersion}" + String baseName = "v${bwcVersion}" - testClusters { - "${baseName}-leader" { - numberOfNodes = 3 - } - "${baseName}-follower" { - numberOfNodes = 3 - } + testClusters { + "${baseName}-leader" { + numberOfNodes = 3 } - testClusters.matching{ it.name.startsWith(baseName)}.all { - testDistribution = "DEFAULT" - versions = [bwcVersion.toString(), project.version] + "${baseName}-follower" { + numberOfNodes = 3 + } + } + testClusters.matching { it.name.startsWith(baseName) }.all { + testDistribution = "DEFAULT" + versions = [bwcVersion.toString(), project.version] - setting 'repositories.url.allowed_urls', 'http://snapshot.test*' - setting 'xpack.security.enabled', 'false' - setting 'xpack.monitoring.enabled', 'false' - setting 'xpack.ml.enabled', 'false' - setting 'xpack.watcher.enabled', 'false' - setting 'xpack.license.self_generated.type', 'trial' + setting 'repositories.url.allowed_urls', 'http://snapshot.test*' + setting 'xpack.security.enabled', 'false' + setting 'xpack.monitoring.enabled', 'false' + setting 'xpack.ml.enabled', 'false' + setting 'xpack.watcher.enabled', 'false' + setting 'xpack.license.self_generated.type', 'trial' - javaHome = BuildParams.runtimeJavaHome + javaHome = BuildParams.runtimeJavaHome + } + + tasks.withType(RestTestRunnerTask).matching { it.name.startsWith(baseName) }.configureEach { + useCluster testClusters."${baseName}-leader" + useCluster testClusters."${baseName}-follower" + systemProperty 'tests.upgrade_from_version', bwcVersion.toString().replace('-SNAPSHOT', '') + + doFirst { + if (name.endsWith("#clusterTest") == false) { + println "Upgrade node $it" + testClusters."${baseName}-${kindExt}".nextNodeToNextVersion() + } + nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}-${kindExt}".allHttpSocketURI.join(",")}") + nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}-${kindExt}".getName()}") + nonInputProperties.systemProperty('tests.leader_host', "${-> testClusters."${baseName}-leader".allHttpSocketURI.last()}") + nonInputProperties.systemProperty('tests.leader_remote_cluster_seed', "${-> testClusters."${baseName}-leader".allTransportPortURI.last()}") + nonInputProperties.systemProperty('tests.follower_host', "${-> testClusters."${baseName}-follower".allHttpSocketURI.last()}") + nonInputProperties.systemProperty('tests.follower_remote_cluster_seed', "${-> testClusters."${baseName}-follower".allTransportPortURI.last()}") + } + } + + for (kind in ["follower", "leader"]) { + // Attention!! Groovy trap: do not pass `kind` to a closure + + tasks.register("${baseName}#${kind}#clusterTest", RestTestRunnerTask) { + systemProperty 'tests.rest.upgrade_state', 'none' + systemProperty 'tests.rest.cluster_name', kind + ext.kindExt = kind } - tasks.withType(RestTestRunnerTask).matching{it.name.startsWith(baseName)}.configureEach { - useCluster testClusters."${baseName}-leader" - useCluster testClusters."${baseName}-follower" - systemProperty 'tests.upgrade_from_version', bwcVersion.toString().replace('-SNAPSHOT', '') - - doFirst { - if (name.endsWith("#clusterTest") == false ) { - println "Upgrade node $it" - testClusters."${baseName}-${kindExt}".nextNodeToNextVersion() - } - nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}-${kindExt}".allHttpSocketURI.join(",") }") - nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}-${kindExt}".getName() }") - nonInputProperties.systemProperty('tests.leader_host', "${-> testClusters."${baseName}-leader".allHttpSocketURI.last()}") - nonInputProperties.systemProperty('tests.leader_remote_cluster_seed', "${-> testClusters."${baseName}-leader".allTransportPortURI.last()}") - nonInputProperties.systemProperty('tests.follower_host', "${-> testClusters."${baseName}-follower".allHttpSocketURI.last()}") - nonInputProperties.systemProperty('tests.follower_remote_cluster_seed', "${-> testClusters."${baseName}-follower".allTransportPortURI.last()}") - } + tasks.register("${baseName}#${kind}#oneThirdUpgradedTest", RestTestRunnerTask) { + systemProperty 'tests.rest.upgrade_state', 'one_third' + systemProperty 'tests.rest.cluster_name', kind + dependsOn "${baseName}#leader#clusterTest", "${baseName}#follower#clusterTest" + ext.kindExt = kind } - for (kind in ["follower", "leader"]) { - // Attention!! Groovy trap: do not pass `kind` to a closure - - tasks.register("${baseName}#${kind}#clusterTest", RestTestRunnerTask) { - systemProperty 'tests.rest.upgrade_state', 'none' - systemProperty 'tests.rest.cluster_name', kind - ext.kindExt = kind - } - - tasks.register("${baseName}#${kind}#oneThirdUpgradedTest", RestTestRunnerTask) { - systemProperty 'tests.rest.upgrade_state', 'one_third' - systemProperty 'tests.rest.cluster_name', kind - dependsOn "${baseName}#leader#clusterTest", "${baseName}#follower#clusterTest" - ext.kindExt = kind - } - - tasks.register("${baseName}#${kind}#twoThirdsUpgradedTest", RestTestRunnerTask) { - systemProperty 'tests.rest.upgrade_state', 'two_third' - systemProperty 'tests.rest.cluster_name', kind - dependsOn "${baseName}#${kind}#oneThirdUpgradedTest" - ext.kindExt = kind - } - - tasks.register("${baseName}#${kind}#upgradedClusterTest", RestTestRunnerTask) { - systemProperty 'tests.rest.upgrade_state', 'all' - systemProperty 'tests.rest.cluster_name', kind - dependsOn "${baseName}#${kind}#twoThirdsUpgradedTest" - ext.kindExt = kind - } + tasks.register("${baseName}#${kind}#twoThirdsUpgradedTest", RestTestRunnerTask) { + systemProperty 'tests.rest.upgrade_state', 'two_third' + systemProperty 'tests.rest.cluster_name', kind + dependsOn "${baseName}#${kind}#oneThirdUpgradedTest" + ext.kindExt = kind } - tasks.named("${baseName}#follower#clusterTest") { - dependsOn "${baseName}#leader#clusterTest" + tasks.register("${baseName}#${kind}#upgradedClusterTest", RestTestRunnerTask) { + systemProperty 'tests.rest.upgrade_state', 'all' + systemProperty 'tests.rest.cluster_name', kind + dependsOn "${baseName}#${kind}#twoThirdsUpgradedTest" + ext.kindExt = kind } + } - tasks.named("${baseName}#leader#oneThirdUpgradedTest") { - dependsOn "${baseName}#follower#upgradedClusterTest" - } + tasks.named("${baseName}#follower#clusterTest") { + dependsOn "${baseName}#leader#clusterTest" + } - tasks.register("${baseName}#bwcTest") { - dependsOn "${baseName}#leader#upgradedClusterTest" - } + tasks.named("${baseName}#leader#oneThirdUpgradedTest") { + dependsOn "${baseName}#follower#upgradedClusterTest" + } - if (project.bwc_tests_enabled) { - bwcTest.dependsOn("${baseName}#bwcTest") - } + tasks.register("${baseName}#bwcTest") { + dependsOn "${baseName}#leader#upgradedClusterTest" + } + + if (project.bwc_tests_enabled) { + bwcTest.dependsOn("${baseName}#bwcTest") + } } task bwcTestSnapshots { - if (project.bwc_tests_enabled) { - for (final def version : bwcVersions.unreleasedWireCompatible) { - dependsOn "v${version}#bwcTest" - } + if (project.bwc_tests_enabled) { + for (final def version : bwcVersions.unreleasedWireCompatible) { + dependsOn "v${version}#bwcTest" } + } } check.dependsOn(bwcTestSnapshots) -test.enabled = false \ No newline at end of file +test.enabled = false diff --git a/x-pack/qa/rolling-upgrade/build.gradle b/x-pack/qa/rolling-upgrade/build.gradle index c55074075a9..d66522c5d3b 100644 --- a/x-pack/qa/rolling-upgrade/build.gradle +++ b/x-pack/qa/rolling-upgrade/build.gradle @@ -19,217 +19,217 @@ forbiddenPatterns { String outputDir = "${buildDir}/generated-resources/${project.name}" tasks.register("bwcTest") { - description = 'Runs backwards compatibility tests.' - group = 'verification' + description = 'Runs backwards compatibility tests.' + group = 'verification' } configurations { - restSpec + restSpec } dependencies { - restSpec project(':rest-api-spec') + restSpec project(':rest-api-spec') } processTestResources { - dependsOn configurations.restSpec - from ({ zipTree(configurations.restSpec.singleFile) }) { - include 'rest-api-spec/api/**' - } - from (project(xpackProject('plugin').path).sourceSets.test.resources) { - include 'rest-api-spec/api/**' - } + dependsOn configurations.restSpec + from({ zipTree(configurations.restSpec.singleFile) }) { + include 'rest-api-spec/api/**' + } + from(project(xpackProject('plugin').path).sourceSets.test.resources) { + include 'rest-api-spec/api/**' + } } task copyTestNodeKeyMaterial(type: Copy) { - from project(':x-pack:plugin:core').files('src/test/resources/org/elasticsearch/xpack/security/transport/ssl/certs/simple/testnode.pem', - 'src/test/resources/org/elasticsearch/xpack/security/transport/ssl/certs/simple/testnode.crt') - into outputDir + from project(':x-pack:plugin:core').files('src/test/resources/org/elasticsearch/xpack/security/transport/ssl/certs/simple/testnode.pem', + 'src/test/resources/org/elasticsearch/xpack/security/transport/ssl/certs/simple/testnode.crt') + into outputDir } for (Version bwcVersion : bwcVersions.wireCompatible) { - String baseName = "v${bwcVersion}" + String baseName = "v${bwcVersion}" - testClusters { - "${baseName}" { - testDistribution = "DEFAULT" - versions = [ bwcVersion.toString(), project.version ] - numberOfNodes = 3 + testClusters { + "${baseName}" { + testDistribution = "DEFAULT" + versions = [bwcVersion.toString(), project.version] + numberOfNodes = 3 - setting 'repositories.url.allowed_urls', 'http://snapshot.test*' - setting 'path.repo', "${buildDir}/cluster/shared/repo/${baseName}" - setting 'http.content_type.required', 'true' - setting 'xpack.license.self_generated.type', 'trial' - setting 'xpack.security.enabled', 'true' - setting 'xpack.security.transport.ssl.enabled', 'true' - setting 'xpack.security.authc.token.enabled', 'true' - setting 'xpack.security.authc.token.timeout', '60m' - setting 'xpack.security.audit.enabled', 'true' - setting 'xpack.security.transport.ssl.key', 'testnode.pem' - setting 'xpack.security.transport.ssl.certificate', 'testnode.crt' + setting 'repositories.url.allowed_urls', 'http://snapshot.test*' + setting 'path.repo', "${buildDir}/cluster/shared/repo/${baseName}" + setting 'http.content_type.required', 'true' + setting 'xpack.license.self_generated.type', 'trial' + setting 'xpack.security.enabled', 'true' + setting 'xpack.security.transport.ssl.enabled', 'true' + setting 'xpack.security.authc.token.enabled', 'true' + setting 'xpack.security.authc.token.timeout', '60m' + setting 'xpack.security.audit.enabled', 'true' + setting 'xpack.security.transport.ssl.key', 'testnode.pem' + setting 'xpack.security.transport.ssl.certificate', 'testnode.crt' - keystore 'xpack.security.transport.ssl.secure_key_passphrase', 'testnode' + keystore 'xpack.security.transport.ssl.secure_key_passphrase', 'testnode' - if (bwcVersion.onOrAfter('7.0.0')) { - setting 'xpack.security.authc.realms.file.file1.order', '0' - setting 'xpack.security.authc.realms.native.native1.order', '1' - } else { - setting 'xpack.security.authc.realms.file1.type', 'file' - setting 'xpack.security.authc.realms.file1.order', '0' - setting 'xpack.security.authc.realms.native1.type', 'native' - setting 'xpack.security.authc.realms.native1.order', '1' - } - if (bwcVersion.onOrAfter('6.6.0')) { - setting 'ccr.auto_follow.wait_for_metadata_timeout', '1s' - } + if (bwcVersion.onOrAfter('7.0.0')) { + setting 'xpack.security.authc.realms.file.file1.order', '0' + setting 'xpack.security.authc.realms.native.native1.order', '1' + } else { + setting 'xpack.security.authc.realms.file1.type', 'file' + setting 'xpack.security.authc.realms.file1.order', '0' + setting 'xpack.security.authc.realms.native1.type', 'native' + setting 'xpack.security.authc.realms.native1.order', '1' + } + if (bwcVersion.onOrAfter('6.6.0')) { + setting 'ccr.auto_follow.wait_for_metadata_timeout', '1s' + } - user username: "test_user", password: "x-pack-test-password" + user username: "test_user", password: "x-pack-test-password" - extraConfigFile 'testnode.pem', file("$outputDir/testnode.pem") - extraConfigFile 'testnode.crt', file("$outputDir/testnode.crt") + extraConfigFile 'testnode.pem', file("$outputDir/testnode.pem") + extraConfigFile 'testnode.crt', file("$outputDir/testnode.crt") - keystore 'xpack.watcher.encryption_key', file("${project.projectDir}/src/test/resources/system_key") - setting 'xpack.watcher.encrypt_sensitive_data', 'true' + keystore 'xpack.watcher.encryption_key', file("${project.projectDir}/src/test/resources/system_key") + setting 'xpack.watcher.encrypt_sensitive_data', 'true' - // Old versions of the code contain an invalid assertion that trips - // during tests. Versions 5.6.9 and 6.2.4 have been fixed by removing - // the assertion, but this is impossible for released versions. - // However, released versions run without assertions, so end users won't - // be suffering the effects. This argument effectively removes the - // incorrect assertion from the older versions used in the BWC tests. - if (bwcVersion.before('5.6.9') || (bwcVersion.onOrAfter('6.0.0') && bwcVersion.before('6.2.4'))) { - jvmArgs '-da:org.elasticsearch.xpack.monitoring.exporter.http.HttpExportBulk' - } + // Old versions of the code contain an invalid assertion that trips + // during tests. Versions 5.6.9 and 6.2.4 have been fixed by removing + // the assertion, but this is impossible for released versions. + // However, released versions run without assertions, so end users won't + // be suffering the effects. This argument effectively removes the + // incorrect assertion from the older versions used in the BWC tests. + if (bwcVersion.before('5.6.9') || (bwcVersion.onOrAfter('6.0.0') && bwcVersion.before('6.2.4'))) { + jvmArgs '-da:org.elasticsearch.xpack.monitoring.exporter.http.HttpExportBulk' + } - javaHome = BuildParams.runtimeJavaHome - } + javaHome = BuildParams.runtimeJavaHome + } + } + + tasks.register("${baseName}#oldClusterTest", RestTestRunnerTask) { + useCluster testClusters."${baseName}" + mustRunAfter(precommit) + dependsOn copyTestNodeKeyMaterial + systemProperty 'tests.rest.suite', 'old_cluster' + systemProperty 'tests.upgrade_from_version', bwcVersion.toString().replace('-SNAPSHOT', '') + nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",")}") + nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName()}") + def toBlackList = [] + // Dataframe transforms were not added until 7.2.0 + if (bwcVersion.before('7.2.0')) { + toBlackList << 'old_cluster/80_data_frame_jobs_crud/Test put batch data frame transforms on old cluster' + } + // continuous Dataframe transforms were not added until 7.3.0 + if (bwcVersion.before('7.3.0')) { + toBlackList << 'old_cluster/80_data_frame_jobs_crud/Test put continuous data frame transform on old cluster' + } + if (!toBlackList.empty) { + systemProperty 'tests.rest.blacklist', toBlackList.join(',') + } + } + + tasks.register("${baseName}#oneThirdUpgradedTest", RestTestRunnerTask) { + dependsOn "${baseName}#oldClusterTest" + useCluster testClusters."${baseName}" + doFirst { + testClusters."${baseName}".nextNodeToNextVersion() + } + nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",")}") + nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName()}") + systemProperty 'tests.rest.suite', 'mixed_cluster' + systemProperty 'tests.first_round', 'true' + systemProperty 'tests.upgrade_from_version', bwcVersion.toString().replace('-SNAPSHOT', '') + // We only need to run these tests once so we may as well do it when we're two thirds upgraded + def toBlackList = [ + 'mixed_cluster/10_basic/Start scroll in mixed cluster on upgraded node that we will continue after upgrade', + 'mixed_cluster/30_ml_jobs_crud/Create a job in the mixed cluster and write some data', + 'mixed_cluster/40_ml_datafeed_crud/Put job and datafeed without aggs in mixed cluster', + 'mixed_cluster/40_ml_datafeed_crud/Put job and datafeed with aggs in mixed cluster', + 'mixed_cluster/80_data_frame_jobs_crud/Test put batch data frame transforms on mixed cluster', + 'mixed_cluster/80_data_frame_jobs_crud/Test put continuous data frame transform on mixed cluster' + ] + // transform in mixed cluster is effectively disabled till 7.4, see gh#48019 + if (bwcVersion.before('7.4.0')) { + toBlackList.addAll([ + 'mixed_cluster/80_data_frame_jobs_crud/Test GET, start, and stop old cluster batch transforms', + 'mixed_cluster/80_data_frame_jobs_crud/Test GET, stop, start, old continuous transforms' + ]) + } + systemProperty 'tests.rest.blacklist', toBlackList.join(',') + } + + tasks.register("${baseName}#twoThirdsUpgradedTest", RestTestRunnerTask) { + dependsOn "${baseName}#oneThirdUpgradedTest" + useCluster testClusters."${baseName}" + doFirst { + testClusters."${baseName}".nextNodeToNextVersion() + } + nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",")}") + nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName()}") + systemProperty 'tests.rest.suite', 'mixed_cluster' + systemProperty 'tests.first_round', 'false' + def toBlackList = [] + // transform in mixed cluster is effectively disabled till 7.4, see gh#48019 + if (bwcVersion.before('7.4.0')) { + toBlackList.addAll([ + 'mixed_cluster/80_data_frame_jobs_crud/Test put batch data frame transforms on mixed cluster', + 'mixed_cluster/80_data_frame_jobs_crud/Test GET, start, and stop old cluster batch transforms', + 'mixed_cluster/80_data_frame_jobs_crud/Test put continuous data frame transform on mixed cluster', + 'mixed_cluster/80_data_frame_jobs_crud/Test GET, stop, start, old continuous transforms' + ]) + } + if (!toBlackList.empty) { + systemProperty 'tests.rest.blacklist', toBlackList.join(',') + } + systemProperty 'tests.upgrade_from_version', bwcVersion.toString().replace('-SNAPSHOT', '') + } + + tasks.register("${baseName}#upgradedClusterTest", RestTestRunnerTask) { + dependsOn "${baseName}#twoThirdsUpgradedTest" + useCluster testClusters."${baseName}" + doFirst { + testClusters."${baseName}".nextNodeToNextVersion() } - tasks.register("${baseName}#oldClusterTest", RestTestRunnerTask) { - useCluster testClusters."${baseName}" - mustRunAfter(precommit) - dependsOn copyTestNodeKeyMaterial - systemProperty 'tests.rest.suite', 'old_cluster' - systemProperty 'tests.upgrade_from_version', bwcVersion.toString().replace('-SNAPSHOT', '') - nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",") }") - nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName() }") - def toBlackList = [] - // Dataframe transforms were not added until 7.2.0 - if (bwcVersion.before('7.2.0')) { - toBlackList << 'old_cluster/80_data_frame_jobs_crud/Test put batch data frame transforms on old cluster' - } - // continuous Dataframe transforms were not added until 7.3.0 - if (bwcVersion.before('7.3.0')) { - toBlackList << 'old_cluster/80_data_frame_jobs_crud/Test put continuous data frame transform on old cluster' - } - if (!toBlackList.empty) { - systemProperty 'tests.rest.blacklist', toBlackList.join(',') - } + nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",")}") + nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName()}") + systemProperty 'tests.rest.suite', 'upgraded_cluster' + systemProperty 'tests.upgrade_from_version', bwcVersion.toString().replace('-SNAPSHOT', '') + def toBlackList = [] + // Dataframe transforms were not added until 7.2.0 + if (bwcVersion.before('7.2.0')) { + toBlackList << 'upgraded_cluster/80_data_frame_jobs_crud/Get start, stop, and delete old cluster batch data frame transforms' + } + // continuous Dataframe transforms were not added until 7.3.0 + if (bwcVersion.before('7.3.0')) { + toBlackList << 'upgraded_cluster/80_data_frame_jobs_crud/Test GET, stop, delete, old continuous transforms' + } + // transform in mixed cluster is effectively disabled till 7.4, see gh#48019 + if (bwcVersion.before('7.4.0')) { + toBlackList << 'upgraded_cluster/80_data_frame_jobs_crud/Get start, stop mixed cluster batch data frame transforms' + toBlackList << 'upgraded_cluster/80_data_frame_jobs_crud/Test GET, mixed continuous transforms' } - tasks.register("${baseName}#oneThirdUpgradedTest", RestTestRunnerTask) { - dependsOn "${baseName}#oldClusterTest" - useCluster testClusters."${baseName}" - doFirst { - testClusters."${baseName}".nextNodeToNextVersion() - } - nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",") }") - nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName() }") - systemProperty 'tests.rest.suite', 'mixed_cluster' - systemProperty 'tests.first_round', 'true' - systemProperty 'tests.upgrade_from_version', bwcVersion.toString().replace('-SNAPSHOT', '') - // We only need to run these tests once so we may as well do it when we're two thirds upgraded - def toBlackList = [ - 'mixed_cluster/10_basic/Start scroll in mixed cluster on upgraded node that we will continue after upgrade', - 'mixed_cluster/30_ml_jobs_crud/Create a job in the mixed cluster and write some data', - 'mixed_cluster/40_ml_datafeed_crud/Put job and datafeed without aggs in mixed cluster', - 'mixed_cluster/40_ml_datafeed_crud/Put job and datafeed with aggs in mixed cluster', - 'mixed_cluster/80_data_frame_jobs_crud/Test put batch data frame transforms on mixed cluster', - 'mixed_cluster/80_data_frame_jobs_crud/Test put continuous data frame transform on mixed cluster' - ] - // transform in mixed cluster is effectively disabled till 7.4, see gh#48019 - if (bwcVersion.before('7.4.0')) { - toBlackList.addAll([ - 'mixed_cluster/80_data_frame_jobs_crud/Test GET, start, and stop old cluster batch transforms', - 'mixed_cluster/80_data_frame_jobs_crud/Test GET, stop, start, old continuous transforms' - ]) - } - systemProperty 'tests.rest.blacklist', toBlackList.join(',') + if (!toBlackList.empty) { + systemProperty 'tests.rest.blacklist', toBlackList.join(',') } + } - tasks.register("${baseName}#twoThirdsUpgradedTest", RestTestRunnerTask) { - dependsOn "${baseName}#oneThirdUpgradedTest" - useCluster testClusters."${baseName}" - doFirst { - testClusters."${baseName}".nextNodeToNextVersion() - } - nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",") }") - nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName() }") - systemProperty 'tests.rest.suite', 'mixed_cluster' - systemProperty 'tests.first_round', 'false' - def toBlackList = [] - // transform in mixed cluster is effectively disabled till 7.4, see gh#48019 - if (bwcVersion.before('7.4.0')) { - toBlackList.addAll([ - 'mixed_cluster/80_data_frame_jobs_crud/Test put batch data frame transforms on mixed cluster', - 'mixed_cluster/80_data_frame_jobs_crud/Test GET, start, and stop old cluster batch transforms', - 'mixed_cluster/80_data_frame_jobs_crud/Test put continuous data frame transform on mixed cluster', - 'mixed_cluster/80_data_frame_jobs_crud/Test GET, stop, start, old continuous transforms' - ]) - } - if (!toBlackList.empty) { - systemProperty 'tests.rest.blacklist', toBlackList.join(',') - } - systemProperty 'tests.upgrade_from_version', bwcVersion.toString().replace('-SNAPSHOT', '') - } + tasks.register("${baseName}#bwcTest") { + dependsOn "${baseName}#upgradedClusterTest" + } - tasks.register("${baseName}#upgradedClusterTest", RestTestRunnerTask) { - dependsOn "${baseName}#twoThirdsUpgradedTest" - useCluster testClusters."${baseName}" - doFirst { - testClusters."${baseName}".nextNodeToNextVersion() - } - - nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",") }") - nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName() }") - systemProperty 'tests.rest.suite', 'upgraded_cluster' - systemProperty 'tests.upgrade_from_version', bwcVersion.toString().replace('-SNAPSHOT', '') - def toBlackList = [] - // Dataframe transforms were not added until 7.2.0 - if (bwcVersion.before('7.2.0')) { - toBlackList << 'upgraded_cluster/80_data_frame_jobs_crud/Get start, stop, and delete old cluster batch data frame transforms' - } - // continuous Dataframe transforms were not added until 7.3.0 - if (bwcVersion.before('7.3.0')) { - toBlackList << 'upgraded_cluster/80_data_frame_jobs_crud/Test GET, stop, delete, old continuous transforms' - } - // transform in mixed cluster is effectively disabled till 7.4, see gh#48019 - if (bwcVersion.before('7.4.0')) { - toBlackList << 'upgraded_cluster/80_data_frame_jobs_crud/Get start, stop mixed cluster batch data frame transforms' - toBlackList << 'upgraded_cluster/80_data_frame_jobs_crud/Test GET, mixed continuous transforms' - } - - if (!toBlackList.empty) { - systemProperty 'tests.rest.blacklist', toBlackList.join(',') - } - } - - tasks.register("${baseName}#bwcTest") { - dependsOn "${baseName}#upgradedClusterTest" - } - - if (project.bwc_tests_enabled) { - bwcTest.dependsOn("${baseName}#bwcTest") - } + if (project.bwc_tests_enabled) { + bwcTest.dependsOn("${baseName}#bwcTest") + } } task bwcTestSnapshots { - if (project.bwc_tests_enabled) { - for (final def version : bwcVersions.unreleasedWireCompatible) { - dependsOn "v${version}#bwcTest" - } + if (project.bwc_tests_enabled) { + for (final def version : bwcVersions.unreleasedWireCompatible) { + dependsOn "v${version}#bwcTest" } + } } check.dependsOn(bwcTestSnapshots) -test.enabled = false \ No newline at end of file +test.enabled = false diff --git a/x-pack/qa/saml-idp-tests/build.gradle b/x-pack/qa/saml-idp-tests/build.gradle index 0ca9dfae214..51842ae398a 100644 --- a/x-pack/qa/saml-idp-tests/build.gradle +++ b/x-pack/qa/saml-idp-tests/build.gradle @@ -6,83 +6,83 @@ apply plugin: 'elasticsearch.rest-test' apply plugin: 'elasticsearch.test.fixtures' dependencies { - testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') - testCompile 'com.google.jimfs:jimfs:1.1' + testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') + testCompile 'com.google.jimfs:jimfs:1.1' } testFixtures.useFixture ":x-pack:test:idp-fixture" String outputDir = "${project.buildDir}/generated-resources/${project.name}" task copyIdpFiles(type: Copy) { - from idpFixtureProject.files('idp/shibboleth-idp/credentials/idp-browser.pem', 'idp/shibboleth-idp/metadata/idp-metadata.xml'); - into outputDir + from idpFixtureProject.files('idp/shibboleth-idp/credentials/idp-browser.pem', 'idp/shibboleth-idp/metadata/idp-metadata.xml'); + into outputDir } project.sourceSets.test.output.dir(outputDir, builtBy: copyIdpFiles) task setupPorts { - dependsOn copyIdpFiles, idpFixtureProject.postProcessFixture - // Don't attempt to get ephemeral ports when Docker is not available - onlyIf { idpFixtureProject.postProcessFixture.enabled } - doLast { - String portString = idpFixtureProject.postProcessFixture.ext."test.fixtures.shibboleth-idp.tcp.4443" - int ephemeralPort = Integer.valueOf(portString) - File idpMetaFile = file("$outputDir/idp-metadata.xml") - List lines = idpMetaFile.readLines("UTF-8") - StringBuilder content = new StringBuilder() - for (String line : lines) { - content.append(line.replace("localhost:4443", "localhost:" + ephemeralPort)) - } - idpMetaFile.delete() - idpMetaFile.createNewFile() - idpMetaFile.write(content.toString(), "UTF-8") + dependsOn copyIdpFiles, idpFixtureProject.postProcessFixture + // Don't attempt to get ephemeral ports when Docker is not available + onlyIf { idpFixtureProject.postProcessFixture.enabled } + doLast { + String portString = idpFixtureProject.postProcessFixture.ext."test.fixtures.shibboleth-idp.tcp.4443" + int ephemeralPort = Integer.valueOf(portString) + File idpMetaFile = file("$outputDir/idp-metadata.xml") + List lines = idpMetaFile.readLines("UTF-8") + StringBuilder content = new StringBuilder() + for (String line : lines) { + content.append(line.replace("localhost:4443", "localhost:" + ephemeralPort)) } + idpMetaFile.delete() + idpMetaFile.createNewFile() + idpMetaFile.write(content.toString(), "UTF-8") + } } integTest.runner.dependsOn setupPorts testClusters.integTest { - testDistribution = 'DEFAULT' - setting 'xpack.license.self_generated.type', 'trial' - setting 'xpack.security.enabled', 'true' - setting 'xpack.security.http.ssl.enabled', 'false' - setting 'xpack.security.authc.token.enabled', 'true' - setting 'xpack.security.authc.realms.file.file.order', '0' - // SAML realm 1 (no authorization_realms) - setting 'xpack.security.authc.realms.saml.shibboleth.order', '1' - setting 'xpack.security.authc.realms.saml.shibboleth.idp.entity_id', 'https://test.shibboleth.elastic.local/' - setting 'xpack.security.authc.realms.saml.shibboleth.idp.metadata.path', 'idp-metadata.xml' - setting 'xpack.security.authc.realms.saml.shibboleth.sp.entity_id', 'http://mock1.http.elastic.local/' - // The port in the ACS URL is fake - the test will bind the mock webserver - // to a random port and then whenever it needs to connect to a URL on the - // mock webserver it will replace 54321 with the real port - setting 'xpack.security.authc.realms.saml.shibboleth.sp.acs', 'http://localhost:54321/saml/acs1' - setting 'xpack.security.authc.realms.saml.shibboleth.attributes.principal', 'uid' - setting 'xpack.security.authc.realms.saml.shibboleth.attributes.name', 'urn:oid:2.5.4.3' - // SAML realm 2 (uses authorization_realms) - setting 'xpack.security.authc.realms.saml.shibboleth_native.order', '2' - setting 'xpack.security.authc.realms.saml.shibboleth_native.idp.entity_id', 'https://test.shibboleth.elastic.local/' - setting 'xpack.security.authc.realms.saml.shibboleth_native.idp.metadata.path', 'idp-metadata.xml' - setting 'xpack.security.authc.realms.saml.shibboleth_native.sp.entity_id', 'http://mock2.http.elastic.local/' - setting 'xpack.security.authc.realms.saml.shibboleth_native.sp.acs', 'http://localhost:54321/saml/acs2' - setting 'xpack.security.authc.realms.saml.shibboleth_native.attributes.principal', 'uid' - setting 'xpack.security.authc.realms.saml.shibboleth_native.authorization_realms', 'native' - // SAML realm 3 (used for negative tests with multiple realms) - setting 'xpack.security.authc.realms.saml.shibboleth_negative.order', '3' - setting 'xpack.security.authc.realms.saml.shibboleth_negative.idp.entity_id', 'https://test.shibboleth.elastic.local/' - setting 'xpack.security.authc.realms.saml.shibboleth_negative.idp.metadata.path', 'idp-metadata.xml' - setting 'xpack.security.authc.realms.saml.shibboleth_negative.sp.entity_id', 'somethingwronghere' - setting 'xpack.security.authc.realms.saml.shibboleth_negative.sp.acs', 'http://localhost:54321/saml/acs3' - setting 'xpack.security.authc.realms.saml.shibboleth_negative.attributes.principal', 'uid' - setting 'xpack.security.authc.realms.saml.shibboleth_negative.authorization_realms', 'native' - setting 'xpack.security.authc.realms.native.native.order', '4' + testDistribution = 'DEFAULT' + setting 'xpack.license.self_generated.type', 'trial' + setting 'xpack.security.enabled', 'true' + setting 'xpack.security.http.ssl.enabled', 'false' + setting 'xpack.security.authc.token.enabled', 'true' + setting 'xpack.security.authc.realms.file.file.order', '0' + // SAML realm 1 (no authorization_realms) + setting 'xpack.security.authc.realms.saml.shibboleth.order', '1' + setting 'xpack.security.authc.realms.saml.shibboleth.idp.entity_id', 'https://test.shibboleth.elastic.local/' + setting 'xpack.security.authc.realms.saml.shibboleth.idp.metadata.path', 'idp-metadata.xml' + setting 'xpack.security.authc.realms.saml.shibboleth.sp.entity_id', 'http://mock1.http.elastic.local/' + // The port in the ACS URL is fake - the test will bind the mock webserver + // to a random port and then whenever it needs to connect to a URL on the + // mock webserver it will replace 54321 with the real port + setting 'xpack.security.authc.realms.saml.shibboleth.sp.acs', 'http://localhost:54321/saml/acs1' + setting 'xpack.security.authc.realms.saml.shibboleth.attributes.principal', 'uid' + setting 'xpack.security.authc.realms.saml.shibboleth.attributes.name', 'urn:oid:2.5.4.3' + // SAML realm 2 (uses authorization_realms) + setting 'xpack.security.authc.realms.saml.shibboleth_native.order', '2' + setting 'xpack.security.authc.realms.saml.shibboleth_native.idp.entity_id', 'https://test.shibboleth.elastic.local/' + setting 'xpack.security.authc.realms.saml.shibboleth_native.idp.metadata.path', 'idp-metadata.xml' + setting 'xpack.security.authc.realms.saml.shibboleth_native.sp.entity_id', 'http://mock2.http.elastic.local/' + setting 'xpack.security.authc.realms.saml.shibboleth_native.sp.acs', 'http://localhost:54321/saml/acs2' + setting 'xpack.security.authc.realms.saml.shibboleth_native.attributes.principal', 'uid' + setting 'xpack.security.authc.realms.saml.shibboleth_native.authorization_realms', 'native' + // SAML realm 3 (used for negative tests with multiple realms) + setting 'xpack.security.authc.realms.saml.shibboleth_negative.order', '3' + setting 'xpack.security.authc.realms.saml.shibboleth_negative.idp.entity_id', 'https://test.shibboleth.elastic.local/' + setting 'xpack.security.authc.realms.saml.shibboleth_negative.idp.metadata.path', 'idp-metadata.xml' + setting 'xpack.security.authc.realms.saml.shibboleth_negative.sp.entity_id', 'somethingwronghere' + setting 'xpack.security.authc.realms.saml.shibboleth_negative.sp.acs', 'http://localhost:54321/saml/acs3' + setting 'xpack.security.authc.realms.saml.shibboleth_negative.attributes.principal', 'uid' + setting 'xpack.security.authc.realms.saml.shibboleth_negative.authorization_realms', 'native' + setting 'xpack.security.authc.realms.native.native.order', '4' - setting 'xpack.ml.enabled', 'false' - setting 'logger.org.elasticsearch.xpack.security', 'TRACE' + setting 'xpack.ml.enabled', 'false' + setting 'logger.org.elasticsearch.xpack.security', 'TRACE' - extraConfigFile 'idp-metadata.xml', file(outputDir + "/idp-metadata.xml") + extraConfigFile 'idp-metadata.xml', file(outputDir + "/idp-metadata.xml") - user username: "test_admin", password: 'x-pack-test-password' + user username: "test_admin", password: 'x-pack-test-password' } forbiddenPatterns { @@ -92,16 +92,16 @@ forbiddenPatterns { } thirdPartyAudit { - ignoreViolations ( - // uses internal java api: sun.misc.Unsafe - 'com.google.common.cache.Striped64', - 'com.google.common.cache.Striped64$1', - 'com.google.common.cache.Striped64$Cell', - 'com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator', - 'com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator$1' - ) + ignoreViolations( + // uses internal java api: sun.misc.Unsafe + 'com.google.common.cache.Striped64', + 'com.google.common.cache.Striped64$1', + 'com.google.common.cache.Striped64$Cell', + 'com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator', + 'com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator$1' + ) - ignoreMissingClasses ( - 'com.ibm.icu.lang.UCharacter' - ) + ignoreMissingClasses( + 'com.ibm.icu.lang.UCharacter' + ) } diff --git a/x-pack/qa/security-client-tests/build.gradle b/x-pack/qa/security-client-tests/build.gradle index 63dd8454139..10e35967efb 100644 --- a/x-pack/qa/security-client-tests/build.gradle +++ b/x-pack/qa/security-client-tests/build.gradle @@ -19,7 +19,7 @@ integTest.runner { } testClusters.integTest { - testDistribution = "default" + testDistribution = "default" setting 'xpack.ilm.enabled', 'false' setting 'xpack.security.enabled', 'true' setting 'xpack.ml.enabled', 'false' diff --git a/x-pack/qa/security-example-spi-extension/build.gradle b/x-pack/qa/security-example-spi-extension/build.gradle index 6176ea2b3d7..4d6d09bc623 100644 --- a/x-pack/qa/security-example-spi-extension/build.gradle +++ b/x-pack/qa/security-example-spi-extension/build.gradle @@ -15,8 +15,8 @@ dependencies { integTest.runner { - dependsOn buildZip - systemProperty 'tests.security.manager', 'false' + dependsOn buildZip + systemProperty 'tests.security.manager', 'false' } testClusters.integTest { @@ -35,5 +35,5 @@ testClusters.integTest { setting 'xpack.monitoring.enabled', 'false' setting 'xpack.license.self_generated.type', 'trial' - user username: "test_user", password: "x-pack-test-password" + user username: "test_user", password: "x-pack-test-password" } diff --git a/x-pack/qa/security-migrate-tests/build.gradle b/x-pack/qa/security-migrate-tests/build.gradle index dec4cfc1489..38a5a45ec2e 100644 --- a/x-pack/qa/security-migrate-tests/build.gradle +++ b/x-pack/qa/security-migrate-tests/build.gradle @@ -8,7 +8,7 @@ dependencies { } testClusters.integTest { - testDistribution = "DEFAULT" + testDistribution = "DEFAULT" setting 'xpack.security.enabled', 'true' setting 'xpack.license.self_generated.type', 'trial' extraConfigFile 'roles.yml', file('roles.yml') @@ -23,7 +23,7 @@ testClusters.integTest { } integTest.runner { - nonInputProperties.systemProperty 'tests.config.dir', "${-> testClusters.integTest.singleNode().getConfigDir()}" + nonInputProperties.systemProperty 'tests.config.dir', "${-> testClusters.integTest.singleNode().getConfigDir()}" } testingConventions { diff --git a/x-pack/qa/security-setup-password-tests/build.gradle b/x-pack/qa/security-setup-password-tests/build.gradle index afa3c95ae90..e22af6ed80d 100644 --- a/x-pack/qa/security-setup-password-tests/build.gradle +++ b/x-pack/qa/security-setup-password-tests/build.gradle @@ -3,20 +3,20 @@ apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' dependencies { - testCompile project(path: xpackModule('core'), configuration: 'default') - testCompile project(path: xpackModule('security'), configuration: 'runtime') - testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') + testCompile project(path: xpackModule('core'), configuration: 'default') + testCompile project(path: xpackModule('security'), configuration: 'runtime') + testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') } integTest.runner { - nonInputProperties.systemProperty 'tests.config.dir', "${-> testClusters.integTest.singleNode().getConfigDir()}" - systemProperty 'tests.security.manager', 'false' + nonInputProperties.systemProperty 'tests.config.dir', "${-> testClusters.integTest.singleNode().getConfigDir()}" + systemProperty 'tests.security.manager', 'false' } testClusters.integTest { - testDistribution = 'DEFAULT' - setting 'xpack.security.enabled', 'true' - setting 'xpack.license.self_generated.type', 'trial' + testDistribution = 'DEFAULT' + setting 'xpack.security.enabled', 'true' + setting 'xpack.license.self_generated.type', 'trial' - user username: "test_admin", password: "x-pack-test-password" + user username: "test_admin", password: "x-pack-test-password" } diff --git a/x-pack/qa/smoke-test-plugins-ssl/build.gradle b/x-pack/qa/smoke-test-plugins-ssl/build.gradle index 77eebff40f1..dc04f7bfa32 100644 --- a/x-pack/qa/smoke-test-plugins-ssl/build.gradle +++ b/x-pack/qa/smoke-test-plugins-ssl/build.gradle @@ -30,7 +30,7 @@ File clientCert = file("$keystoreDir/testclient.crt") // Add keystores to test classpath: it expects it there task copyKeyCerts(type: Copy) { from('./') { - include '*.crt', '*.pem', '*.jks' + include '*.crt', '*.pem', '*.jks' } into keystoreDir } diff --git a/x-pack/qa/smoke-test-watcher-with-security/build.gradle b/x-pack/qa/smoke-test-watcher-with-security/build.gradle index 1e56abba3cc..6b64c4745c4 100644 --- a/x-pack/qa/smoke-test-watcher-with-security/build.gradle +++ b/x-pack/qa/smoke-test-watcher-with-security/build.gradle @@ -24,7 +24,7 @@ testClusters.integTest { setting 'xpack.notification.email.account._email.smtp.host', 'host.domain' setting 'xpack.notification.email.account._email.smtp.port', '587' setting 'xpack.notification.email.account._email.smtp.user', '_user' - keystore 'xpack.notification.email.account._email.smtp.secure_password', '_passwd' + keystore 'xpack.notification.email.account._email.smtp.secure_password', '_passwd' setting 'xpack.license.self_generated.type', 'trial' extraConfigFile 'roles.yml', file('roles.yml') user username: "test_admin", password: "x-pack-test-password" diff --git a/x-pack/qa/smoke-test-watcher/build.gradle b/x-pack/qa/smoke-test-watcher/build.gradle index 7bc68fee9f4..0bea04ef9b8 100644 --- a/x-pack/qa/smoke-test-watcher/build.gradle +++ b/x-pack/qa/smoke-test-watcher/build.gradle @@ -14,4 +14,4 @@ testClusters.integTest { setting 'xpack.ml.enabled', 'false' setting 'xpack.license.self_generated.type', 'trial' setting 'logger.org.elasticsearch.xpack.watcher', 'DEBUG' -} \ No newline at end of file +} diff --git a/x-pack/qa/third-party/active-directory/build.gradle b/x-pack/qa/third-party/active-directory/build.gradle index b76b25b08ea..f977c49e7b2 100644 --- a/x-pack/qa/third-party/active-directory/build.gradle +++ b/x-pack/qa/third-party/active-directory/build.gradle @@ -10,7 +10,7 @@ testFixtures.useFixture ":x-pack:test:smb-fixture" // add test resources from security, so tests can use example certs processTestResources { - from(project(xpackModule('security')).sourceSets.test.resources.srcDirs) + from(project(xpackModule('security')).sourceSets.test.resources.srcDirs) } compileTestJava.options.compilerArgs << "-Xlint:-rawtypes,-unchecked" diff --git a/x-pack/qa/third-party/jira/build.gradle b/x-pack/qa/third-party/jira/build.gradle index c503981a1a8..f724d5f1f36 100644 --- a/x-pack/qa/third-party/jira/build.gradle +++ b/x-pack/qa/third-party/jira/build.gradle @@ -42,16 +42,16 @@ task cleanJira(type: DefaultTask) { // require network access for this one, exit early instead of starting up the cluster if we dont have network if (!jiraUrl && !jiraUser && !jiraPassword && !jiraProject) { - integTest.enabled = false - testingConventions.enabled = false + integTest.enabled = false + testingConventions.enabled = false } else { - testClusters.integTest { - setting 'xpack.notification.jira.account.test.issue_defaults.project.key', jiraProject - keystore 'xpack.notification.jira.account.test.secure_url', jiraUrl - keystore 'xpack.notification.jira.account.test.secure_user', jiraUser - keystore 'xpack.notification.jira.account.test.secure_password', jiraPassword - } - integTest.runner.finalizedBy cleanJira + testClusters.integTest { + setting 'xpack.notification.jira.account.test.issue_defaults.project.key', jiraProject + keystore 'xpack.notification.jira.account.test.secure_url', jiraUrl + keystore 'xpack.notification.jira.account.test.secure_user', jiraUser + keystore 'xpack.notification.jira.account.test.secure_password', jiraPassword + } + integTest.runner.finalizedBy cleanJira } /** List all issues associated to a given Jira project **/ @@ -59,7 +59,7 @@ def jiraIssues(projectKey) { // See https://docs.atlassian.com/jira/REST/cloud/#api/2/search-search def response = jiraHttpRequest("search?maxResults=100&fields=id,self,key&jql=project%3D${projectKey}", "GET", 200) assert response.issues instanceof List - return response.issues.findAll {it.key.startsWith(projectKey)}.collect {it.key} + return response.issues.findAll { it.key.startsWith(projectKey) }.collect { it.key } } /** Execute an HTTP request against the Jira server instance **/ diff --git a/x-pack/qa/third-party/slack/build.gradle b/x-pack/qa/third-party/slack/build.gradle index de0550be819..815d1cb3bbf 100644 --- a/x-pack/qa/third-party/slack/build.gradle +++ b/x-pack/qa/third-party/slack/build.gradle @@ -19,6 +19,6 @@ if (!slackUrl) { setting 'xpack.ml.enabled', 'false' setting 'xpack.license.self_generated.type', 'trial' setting 'logger.org.elasticsearch.xpack.watcher', 'DEBUG' - keystore 'xpack.notification.slack.account.test_account.secure_url', slackUrl + keystore 'xpack.notification.slack.account.test_account.secure_url', slackUrl } } diff --git a/x-pack/qa/transport-client-tests/build.gradle b/x-pack/qa/transport-client-tests/build.gradle index ae4722a0474..eec6735db4a 100644 --- a/x-pack/qa/transport-client-tests/build.gradle +++ b/x-pack/qa/transport-client-tests/build.gradle @@ -7,7 +7,7 @@ dependencies { } testClusters.integTest { - testDistribution = "DEFAULT" + testDistribution = "DEFAULT" setting 'xpack.security.enabled', 'false' setting 'xpack.license.self_generated.type', 'trial' } diff --git a/x-pack/snapshot-tool/build.gradle b/x-pack/snapshot-tool/build.gradle index 54edaf847ee..a18ac738ad2 100644 --- a/x-pack/snapshot-tool/build.gradle +++ b/x-pack/snapshot-tool/build.gradle @@ -152,7 +152,7 @@ thirdPartyAudit.ignoreMissingClasses( 'com.amazonaws.services.kms.model.EncryptResult', 'com.amazonaws.services.kms.model.GenerateDataKeyRequest', 'com.amazonaws.services.kms.model.GenerateDataKeyResult', - + 'com.google.appengine.api.datastore.Blob', 'com.google.appengine.api.datastore.DatastoreService', 'com.google.appengine.api.datastore.DatastoreServiceFactory', @@ -184,107 +184,107 @@ thirdPartyAudit.ignoreMissingClasses( rootProject.globalInfo.ready { if (BuildParams.runtimeJavaVersion <= JavaVersion.VERSION_1_8) { thirdPartyAudit.ignoreJarHellWithJDK( - 'javax.xml.bind.Binder', - 'javax.xml.bind.ContextFinder$1', - 'javax.xml.bind.ContextFinder', - 'javax.xml.bind.DataBindingException', - 'javax.xml.bind.DatatypeConverter', - 'javax.xml.bind.DatatypeConverterImpl$CalendarFormatter', - 'javax.xml.bind.DatatypeConverterImpl', - 'javax.xml.bind.DatatypeConverterInterface', - 'javax.xml.bind.Element', - 'javax.xml.bind.GetPropertyAction', - 'javax.xml.bind.JAXB$Cache', - 'javax.xml.bind.JAXB', - 'javax.xml.bind.JAXBContext', - 'javax.xml.bind.JAXBElement$GlobalScope', - 'javax.xml.bind.JAXBElement', - 'javax.xml.bind.JAXBException', - 'javax.xml.bind.JAXBIntrospector', - 'javax.xml.bind.JAXBPermission', - 'javax.xml.bind.MarshalException', - 'javax.xml.bind.Marshaller$Listener', - 'javax.xml.bind.Marshaller', - 'javax.xml.bind.Messages', - 'javax.xml.bind.NotIdentifiableEvent', - 'javax.xml.bind.ParseConversionEvent', - 'javax.xml.bind.PrintConversionEvent', - 'javax.xml.bind.PropertyException', - 'javax.xml.bind.SchemaOutputResolver', - 'javax.xml.bind.TypeConstraintException', - 'javax.xml.bind.UnmarshalException', - 'javax.xml.bind.Unmarshaller$Listener', - 'javax.xml.bind.Unmarshaller', - 'javax.xml.bind.UnmarshallerHandler', - 'javax.xml.bind.ValidationEvent', - 'javax.xml.bind.ValidationEventHandler', - 'javax.xml.bind.ValidationEventLocator', - 'javax.xml.bind.ValidationException', - 'javax.xml.bind.Validator', - 'javax.xml.bind.WhiteSpaceProcessor', - 'javax.xml.bind.annotation.DomHandler', - 'javax.xml.bind.annotation.W3CDomHandler', - 'javax.xml.bind.annotation.XmlAccessOrder', - 'javax.xml.bind.annotation.XmlAccessType', - 'javax.xml.bind.annotation.XmlAccessorOrder', - 'javax.xml.bind.annotation.XmlAccessorType', - 'javax.xml.bind.annotation.XmlAnyAttribute', - 'javax.xml.bind.annotation.XmlAnyElement', - 'javax.xml.bind.annotation.XmlAttachmentRef', - 'javax.xml.bind.annotation.XmlAttribute', - 'javax.xml.bind.annotation.XmlElement$DEFAULT', - 'javax.xml.bind.annotation.XmlElement', - 'javax.xml.bind.annotation.XmlElementDecl$GLOBAL', - 'javax.xml.bind.annotation.XmlElementDecl', - 'javax.xml.bind.annotation.XmlElementRef$DEFAULT', - 'javax.xml.bind.annotation.XmlElementRef', - 'javax.xml.bind.annotation.XmlElementRefs', - 'javax.xml.bind.annotation.XmlElementWrapper', - 'javax.xml.bind.annotation.XmlElements', - 'javax.xml.bind.annotation.XmlEnum', - 'javax.xml.bind.annotation.XmlEnumValue', - 'javax.xml.bind.annotation.XmlID', - 'javax.xml.bind.annotation.XmlIDREF', - 'javax.xml.bind.annotation.XmlInlineBinaryData', - 'javax.xml.bind.annotation.XmlList', - 'javax.xml.bind.annotation.XmlMimeType', - 'javax.xml.bind.annotation.XmlMixed', - 'javax.xml.bind.annotation.XmlNs', - 'javax.xml.bind.annotation.XmlNsForm', - 'javax.xml.bind.annotation.XmlRegistry', - 'javax.xml.bind.annotation.XmlRootElement', - 'javax.xml.bind.annotation.XmlSchema', - 'javax.xml.bind.annotation.XmlSchemaType$DEFAULT', - 'javax.xml.bind.annotation.XmlSchemaType', - 'javax.xml.bind.annotation.XmlSchemaTypes', - 'javax.xml.bind.annotation.XmlSeeAlso', - 'javax.xml.bind.annotation.XmlTransient', - 'javax.xml.bind.annotation.XmlType$DEFAULT', - 'javax.xml.bind.annotation.XmlType', - 'javax.xml.bind.annotation.XmlValue', - 'javax.xml.bind.annotation.adapters.CollapsedStringAdapter', - 'javax.xml.bind.annotation.adapters.HexBinaryAdapter', - 'javax.xml.bind.annotation.adapters.NormalizedStringAdapter', - 'javax.xml.bind.annotation.adapters.XmlAdapter', - 'javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter$DEFAULT', - 'javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter', - 'javax.xml.bind.annotation.adapters.XmlJavaTypeAdapters', - 'javax.xml.bind.attachment.AttachmentMarshaller', - 'javax.xml.bind.attachment.AttachmentUnmarshaller', - 'javax.xml.bind.helpers.AbstractMarshallerImpl', - 'javax.xml.bind.helpers.AbstractUnmarshallerImpl', - 'javax.xml.bind.helpers.DefaultValidationEventHandler', - 'javax.xml.bind.helpers.Messages', - 'javax.xml.bind.helpers.NotIdentifiableEventImpl', - 'javax.xml.bind.helpers.ParseConversionEventImpl', - 'javax.xml.bind.helpers.PrintConversionEventImpl', - 'javax.xml.bind.helpers.ValidationEventImpl', - 'javax.xml.bind.helpers.ValidationEventLocatorImpl', - 'javax.xml.bind.util.JAXBResult', - 'javax.xml.bind.util.JAXBSource$1', - 'javax.xml.bind.util.JAXBSource', - 'javax.xml.bind.util.Messages', - 'javax.xml.bind.util.ValidationEventCollector' + 'javax.xml.bind.Binder', + 'javax.xml.bind.ContextFinder$1', + 'javax.xml.bind.ContextFinder', + 'javax.xml.bind.DataBindingException', + 'javax.xml.bind.DatatypeConverter', + 'javax.xml.bind.DatatypeConverterImpl$CalendarFormatter', + 'javax.xml.bind.DatatypeConverterImpl', + 'javax.xml.bind.DatatypeConverterInterface', + 'javax.xml.bind.Element', + 'javax.xml.bind.GetPropertyAction', + 'javax.xml.bind.JAXB$Cache', + 'javax.xml.bind.JAXB', + 'javax.xml.bind.JAXBContext', + 'javax.xml.bind.JAXBElement$GlobalScope', + 'javax.xml.bind.JAXBElement', + 'javax.xml.bind.JAXBException', + 'javax.xml.bind.JAXBIntrospector', + 'javax.xml.bind.JAXBPermission', + 'javax.xml.bind.MarshalException', + 'javax.xml.bind.Marshaller$Listener', + 'javax.xml.bind.Marshaller', + 'javax.xml.bind.Messages', + 'javax.xml.bind.NotIdentifiableEvent', + 'javax.xml.bind.ParseConversionEvent', + 'javax.xml.bind.PrintConversionEvent', + 'javax.xml.bind.PropertyException', + 'javax.xml.bind.SchemaOutputResolver', + 'javax.xml.bind.TypeConstraintException', + 'javax.xml.bind.UnmarshalException', + 'javax.xml.bind.Unmarshaller$Listener', + 'javax.xml.bind.Unmarshaller', + 'javax.xml.bind.UnmarshallerHandler', + 'javax.xml.bind.ValidationEvent', + 'javax.xml.bind.ValidationEventHandler', + 'javax.xml.bind.ValidationEventLocator', + 'javax.xml.bind.ValidationException', + 'javax.xml.bind.Validator', + 'javax.xml.bind.WhiteSpaceProcessor', + 'javax.xml.bind.annotation.DomHandler', + 'javax.xml.bind.annotation.W3CDomHandler', + 'javax.xml.bind.annotation.XmlAccessOrder', + 'javax.xml.bind.annotation.XmlAccessType', + 'javax.xml.bind.annotation.XmlAccessorOrder', + 'javax.xml.bind.annotation.XmlAccessorType', + 'javax.xml.bind.annotation.XmlAnyAttribute', + 'javax.xml.bind.annotation.XmlAnyElement', + 'javax.xml.bind.annotation.XmlAttachmentRef', + 'javax.xml.bind.annotation.XmlAttribute', + 'javax.xml.bind.annotation.XmlElement$DEFAULT', + 'javax.xml.bind.annotation.XmlElement', + 'javax.xml.bind.annotation.XmlElementDecl$GLOBAL', + 'javax.xml.bind.annotation.XmlElementDecl', + 'javax.xml.bind.annotation.XmlElementRef$DEFAULT', + 'javax.xml.bind.annotation.XmlElementRef', + 'javax.xml.bind.annotation.XmlElementRefs', + 'javax.xml.bind.annotation.XmlElementWrapper', + 'javax.xml.bind.annotation.XmlElements', + 'javax.xml.bind.annotation.XmlEnum', + 'javax.xml.bind.annotation.XmlEnumValue', + 'javax.xml.bind.annotation.XmlID', + 'javax.xml.bind.annotation.XmlIDREF', + 'javax.xml.bind.annotation.XmlInlineBinaryData', + 'javax.xml.bind.annotation.XmlList', + 'javax.xml.bind.annotation.XmlMimeType', + 'javax.xml.bind.annotation.XmlMixed', + 'javax.xml.bind.annotation.XmlNs', + 'javax.xml.bind.annotation.XmlNsForm', + 'javax.xml.bind.annotation.XmlRegistry', + 'javax.xml.bind.annotation.XmlRootElement', + 'javax.xml.bind.annotation.XmlSchema', + 'javax.xml.bind.annotation.XmlSchemaType$DEFAULT', + 'javax.xml.bind.annotation.XmlSchemaType', + 'javax.xml.bind.annotation.XmlSchemaTypes', + 'javax.xml.bind.annotation.XmlSeeAlso', + 'javax.xml.bind.annotation.XmlTransient', + 'javax.xml.bind.annotation.XmlType$DEFAULT', + 'javax.xml.bind.annotation.XmlType', + 'javax.xml.bind.annotation.XmlValue', + 'javax.xml.bind.annotation.adapters.CollapsedStringAdapter', + 'javax.xml.bind.annotation.adapters.HexBinaryAdapter', + 'javax.xml.bind.annotation.adapters.NormalizedStringAdapter', + 'javax.xml.bind.annotation.adapters.XmlAdapter', + 'javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter$DEFAULT', + 'javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter', + 'javax.xml.bind.annotation.adapters.XmlJavaTypeAdapters', + 'javax.xml.bind.attachment.AttachmentMarshaller', + 'javax.xml.bind.attachment.AttachmentUnmarshaller', + 'javax.xml.bind.helpers.AbstractMarshallerImpl', + 'javax.xml.bind.helpers.AbstractUnmarshallerImpl', + 'javax.xml.bind.helpers.DefaultValidationEventHandler', + 'javax.xml.bind.helpers.Messages', + 'javax.xml.bind.helpers.NotIdentifiableEventImpl', + 'javax.xml.bind.helpers.ParseConversionEventImpl', + 'javax.xml.bind.helpers.PrintConversionEventImpl', + 'javax.xml.bind.helpers.ValidationEventImpl', + 'javax.xml.bind.helpers.ValidationEventLocatorImpl', + 'javax.xml.bind.util.JAXBResult', + 'javax.xml.bind.util.JAXBSource$1', + 'javax.xml.bind.util.JAXBSource', + 'javax.xml.bind.util.Messages', + 'javax.xml.bind.util.ValidationEventCollector' ) } else { thirdPartyAudit.ignoreMissingClasses 'javax.activation.DataHandler' diff --git a/x-pack/snapshot-tool/qa/google-cloud-storage/build.gradle b/x-pack/snapshot-tool/qa/google-cloud-storage/build.gradle index ceb429a18f8..50886cb3c27 100644 --- a/x-pack/snapshot-tool/qa/google-cloud-storage/build.gradle +++ b/x-pack/snapshot-tool/qa/google-cloud-storage/build.gradle @@ -8,16 +8,16 @@ import java.nio.file.Files apply plugin: 'elasticsearch.build' dependencies { - compile project(":plugins:repository-gcs") - testCompile project(":test:framework") - testCompile project(':x-pack:snapshot-tool') - testCompile files(project(':x-pack:snapshot-tool').sourceSets.test.output) + compile project(":plugins:repository-gcs") + testCompile project(":test:framework") + testCompile project(':x-pack:snapshot-tool') + testCompile files(project(':x-pack:snapshot-tool').sourceSets.test.output) } test.enabled = false task gcsThirdPartyTests { - dependsOn check + dependsOn check } boolean useGCSFixture = false @@ -27,62 +27,62 @@ String gcsBucket = System.getenv("google_storage_bucket") String gcsBasePath = System.getenv("google_storage_base_path") if (!gcsServiceAccount && !gcsBucket && !gcsBasePath) { - gcsServiceAccount = new File(project(':plugins:repository-gcs:qa:google-cloud-storage').buildDir, - 'generated-resources/service_account_test.json').path - gcsBucket = 'bucket_test' - gcsBasePath = 'integration_test' + gcsServiceAccount = new File(project(':plugins:repository-gcs:qa:google-cloud-storage').buildDir, + 'generated-resources/service_account_test.json').path + gcsBucket = 'bucket_test' + gcsBasePath = 'integration_test' - useGCSFixture = true + useGCSFixture = true } else if (!gcsServiceAccount || !gcsBucket || !gcsBasePath) { - throw new IllegalArgumentException("not all options specified to run thirdPartyTestGCS against external GCS service are present") + throw new IllegalArgumentException("not all options specified to run thirdPartyTestGCS against external GCS service are present") } def encodedCredentials = { - Base64.encoder.encodeToString(Files.readAllBytes(file(gcsServiceAccount).toPath())) + Base64.encoder.encodeToString(Files.readAllBytes(file(gcsServiceAccount).toPath())) } -task thirdPartyTest (type: Test) { - include '**/GCSCleanupTests.class' +task thirdPartyTest(type: Test) { + include '**/GCSCleanupTests.class' - systemProperty 'tests.security.manager', false + systemProperty 'tests.security.manager', false - systemProperty 'test.google.bucket', gcsBucket - systemProperty 'test.google.base', gcsBasePath - nonInputProperties.systemProperty 'test.google.account', "${-> encodedCredentials.call()}" + systemProperty 'test.google.bucket', gcsBucket + systemProperty 'test.google.base', gcsBasePath + nonInputProperties.systemProperty 'test.google.account', "${-> encodedCredentials.call()}" } if (useGCSFixture) { - thirdPartyTest.enabled = false; - testingConventions.enabled = false; - /* + thirdPartyTest.enabled = false; + testingConventions.enabled = false; + /* - See: https://github.com/elastic/elasticsearch/issues/46813 Fails with --parallel + See: https://github.com/elastic/elasticsearch/issues/46813 Fails with --parallel - thirdPartyTest.dependsOn(':plugins:repository-gcs:qa:google-cloud-storage:createServiceAccountFile', + thirdPartyTest.dependsOn(':plugins:repository-gcs:qa:google-cloud-storage:createServiceAccountFile', - ':plugins:repository-gcs:qa:google-cloud-storage:googleCloudStorageFixture') - thirdPartyTest.finalizedBy(':plugins:repository-gcs:qa:google-cloud-storage:googleCloudStorageFixture#stop') + ':plugins:repository-gcs:qa:google-cloud-storage:googleCloudStorageFixture') + thirdPartyTest.finalizedBy(':plugins:repository-gcs:qa:google-cloud-storage:googleCloudStorageFixture#stop') - def fixtureEndpoint = { - "http://${project(':plugins:repository-gcs:qa:google-cloud-storage').googleCloudStorageFixture.addressAndPort}" - } + def fixtureEndpoint = { + "http://${project(':plugins:repository-gcs:qa:google-cloud-storage').googleCloudStorageFixture.addressAndPort}" + } - def tokenURI = { - "http://${project(':plugins:repository-gcs:qa:google-cloud-storage').googleCloudStorageFixture.addressAndPort}/o/oauth2/token" - } + def tokenURI = { + "http://${project(':plugins:repository-gcs:qa:google-cloud-storage').googleCloudStorageFixture.addressAndPort}/o/oauth2/token" + } - thirdPartyTest { - nonInputProperties.systemProperty 'test.google.endpoint', "${-> fixtureEndpoint.call()}" - nonInputProperties.systemProperty 'test.google.tokenURI', "${-> tokenURI.call()}" - } + thirdPartyTest { + nonInputProperties.systemProperty 'test.google.endpoint', "${-> fixtureEndpoint.call()}" + nonInputProperties.systemProperty 'test.google.tokenURI', "${-> tokenURI.call()}" + } - gradle.taskGraph.whenReady { - if (it.hasTask(gcsThirdPartyTests)) { - throw new IllegalStateException("Tried to run third party tests but not all of the necessary environment variables 'google_storage_service_account', " + - "'google_storage_bucket', 'google_storage_base_path' are set.") - } - } - */ + gradle.taskGraph.whenReady { + if (it.hasTask(gcsThirdPartyTests)) { + throw new IllegalStateException("Tried to run third party tests but not all of the necessary environment variables 'google_storage_service_account', " + + "'google_storage_bucket', 'google_storage_base_path' are set.") + } + } + */ } -check.dependsOn(thirdPartyTest) \ No newline at end of file +check.dependsOn(thirdPartyTest) diff --git a/x-pack/snapshot-tool/qa/s3/build.gradle b/x-pack/snapshot-tool/qa/s3/build.gradle index 0ca2a171d48..e36bcdac6aa 100644 --- a/x-pack/snapshot-tool/qa/s3/build.gradle +++ b/x-pack/snapshot-tool/qa/s3/build.gradle @@ -6,16 +6,16 @@ apply plugin: 'elasticsearch.build' dependencies { - compile project(":plugins:repository-s3") - testCompile project(":test:framework") - testCompile project(':x-pack:snapshot-tool') - testCompile files(project(':x-pack:snapshot-tool').sourceSets.test.output) + compile project(":plugins:repository-s3") + testCompile project(":test:framework") + testCompile project(':x-pack:snapshot-tool') + testCompile files(project(':x-pack:snapshot-tool').sourceSets.test.output) } test.enabled = false task s3ThirdPartyTests { - dependsOn check + dependsOn check } boolean useS3Fixture = false @@ -26,70 +26,70 @@ String s3PermanentBucket = System.getenv("amazon_s3_bucket") String s3PermanentBasePath = System.getenv("amazon_s3_base_path") if (!s3PermanentAccessKey && !s3PermanentSecretKey && !s3PermanentBucket && !s3PermanentBasePath) { - s3PermanentAccessKey = 's3_integration_test_permanent_access_key' - s3PermanentSecretKey = 's3_integration_test_permanent_secret_key' - s3PermanentBucket = 'permanent-bucket-test' - s3PermanentBasePath = 'integration_test' + s3PermanentAccessKey = 's3_integration_test_permanent_access_key' + s3PermanentSecretKey = 's3_integration_test_permanent_secret_key' + s3PermanentBucket = 'permanent-bucket-test' + s3PermanentBasePath = 'integration_test' - useS3Fixture = true + useS3Fixture = true } else if (!s3PermanentAccessKey || !s3PermanentSecretKey || !s3PermanentBucket || !s3PermanentBasePath) { - throw new IllegalArgumentException("not all options specified to run against external S3 service as permanent credentials are present") + throw new IllegalArgumentException("not all options specified to run against external S3 service as permanent credentials are present") } -task thirdPartyTest (type: Test) { - include '**/*.class' +task thirdPartyTest(type: Test) { + include '**/*.class' - systemProperty 'tests.security.manager', false + systemProperty 'tests.security.manager', false - systemProperty 'test.s3.account', s3PermanentAccessKey - systemProperty 'test.s3.key', s3PermanentSecretKey - systemProperty 'test.s3.bucket', s3PermanentBucket - systemProperty 'test.s3.base', s3PermanentBasePath + systemProperty 'test.s3.account', s3PermanentAccessKey + systemProperty 'test.s3.key', s3PermanentSecretKey + systemProperty 'test.s3.bucket', s3PermanentBucket + systemProperty 'test.s3.base', s3PermanentBasePath } if (useS3Fixture) { - thirdPartyTest.enabled = false; - testingConventions.enabled = false; - /* + thirdPartyTest.enabled = false; + testingConventions.enabled = false; + /* - See: https://github.com/elastic/elasticsearch/issues/46813 Fails with --parallel + See: https://github.com/elastic/elasticsearch/issues/46813 Fails with --parallel - apply plugin: 'elasticsearch.test.fixtures' + apply plugin: 'elasticsearch.test.fixtures' - task writeDockerFile { - File minioDockerfile = new File("${project.buildDir}/minio-docker/Dockerfile") - outputs.file(minioDockerfile) - doLast { - minioDockerfile.parentFile.mkdirs() - minioDockerfile.text = - "FROM minio/minio:RELEASE.2019-01-23T23-18-58Z\n" + - "RUN mkdir -p /minio/data/${s3PermanentBucket}\n" + - "ENV MINIO_ACCESS_KEY ${s3PermanentAccessKey}\n" + - "ENV MINIO_SECRET_KEY ${s3PermanentSecretKey}" - } - } + task writeDockerFile { + File minioDockerfile = new File("${project.buildDir}/minio-docker/Dockerfile") + outputs.file(minioDockerfile) + doLast { + minioDockerfile.parentFile.mkdirs() + minioDockerfile.text = + "FROM minio/minio:RELEASE.2019-01-23T23-18-58Z\n" + + "RUN mkdir -p /minio/data/${s3PermanentBucket}\n" + + "ENV MINIO_ACCESS_KEY ${s3PermanentAccessKey}\n" + + "ENV MINIO_SECRET_KEY ${s3PermanentSecretKey}" + } + } - preProcessFixture { - dependsOn(writeDockerFile) - } + preProcessFixture { + dependsOn(writeDockerFile) + } - def minioAddress = { - int minioPort = postProcessFixture.ext."test.fixtures.minio-fixture.tcp.9000" - assert minioPort > 0 - 'http://127.0.0.1:' + minioPort - } + def minioAddress = { + int minioPort = postProcessFixture.ext."test.fixtures.minio-fixture.tcp.9000" + assert minioPort > 0 + 'http://127.0.0.1:' + minioPort + } - thirdPartyTest { - dependsOn tasks.postProcessFixture - nonInputProperties.systemProperty 'test.s3.endpoint', "${ -> minioAddress.call() }" - } + thirdPartyTest { + dependsOn tasks.postProcessFixture + nonInputProperties.systemProperty 'test.s3.endpoint', "${ -> minioAddress.call() }" + } - gradle.taskGraph.whenReady { - if (it.hasTask(s3ThirdPartyTests)) { - throw new IllegalStateException("Tried to run third party tests but not all of the necessary environment variables 'amazon_s3_access_key', " + - "'amazon_s3_secret_key', 'amazon_s3_bucket', and 'amazon_s3_base_path' are set."); - } - }*/ + gradle.taskGraph.whenReady { + if (it.hasTask(s3ThirdPartyTests)) { + throw new IllegalStateException("Tried to run third party tests but not all of the necessary environment variables 'amazon_s3_access_key', " + + "'amazon_s3_secret_key', 'amazon_s3_bucket', and 'amazon_s3_base_path' are set."); + } + }*/ } -check.dependsOn(thirdPartyTest) \ No newline at end of file +check.dependsOn(thirdPartyTest) diff --git a/x-pack/transport-client/build.gradle b/x-pack/transport-client/build.gradle index 080ad83c495..0254cbabcf3 100644 --- a/x-pack/transport-client/build.gradle +++ b/x-pack/transport-client/build.gradle @@ -6,36 +6,36 @@ group = 'org.elasticsearch.client' archivesBaseName = 'x-pack-transport' dependencies { - // this "api" dependency looks weird, but it is correct, as it contains - // all of x-pack for now, and transport client will be going away in the future. - compile project(xpackModule('core')) - compile project(':client:transport') - testCompile "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${versions.randomizedrunner}" - testCompile "junit:junit:${versions.junit}" - testCompile "org.hamcrest:hamcrest:${versions.hamcrest}" + // this "api" dependency looks weird, but it is correct, as it contains + // all of x-pack for now, and transport client will be going away in the future. + compile project(xpackModule('core')) + compile project(':client:transport') + testCompile "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${versions.randomizedrunner}" + testCompile "junit:junit:${versions.junit}" + testCompile "org.hamcrest:hamcrest:${versions.hamcrest}" } dependencyLicenses.enabled = false forbiddenApisTest { - // we don't use the core test-framework, no lucene classes present so we don't want the es-test-signatures to - // be pulled in - replaceSignatureFiles 'jdk-signatures', 'es-all-signatures' + // we don't use the core test-framework, no lucene classes present so we don't want the es-test-signatures to + // be pulled in + replaceSignatureFiles 'jdk-signatures', 'es-all-signatures' } testingConventions { - naming.clear() - naming { - Tests { - baseClass 'com.carrotsearch.randomizedtesting.RandomizedTest' - } + naming.clear() + naming { + Tests { + baseClass 'com.carrotsearch.randomizedtesting.RandomizedTest' } + } } publishing { - publications { - nebula(MavenPublication) { - artifactId = archivesBaseName - } + publications { + nebula(MavenPublication) { + artifactId = archivesBaseName } + } }