logstash/x-pack/build.gradle
Andrea Selva 2e6ed1d7e4
Fixes to build and run Logstah on JDK 17 (#13306) (#13331)
Backport #13306 to branch 7.x

(cherry picked from commit 7395641a43)

----

This commit applies all the changes needed to run Logstash on JDK 17:
- opens access to module java.base for packages sun.nio.ch and java.io to run the application and to execute the tests
- removes SecurityManager classes used during Logstash startup
- fix exception type catched in JavaKeyStore tampering test

Related to meta issue #13306
2021-10-18 16:38:38 +02:00

64 lines
1.7 KiB
Groovy

/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
description = """Logstash X-Pack"""
repositories {
mavenCentral()
}
buildscript {
repositories {
mavenCentral()
}
}
configurations {
geolite2
}
dependencies {
testImplementation project(':logstash-core')
testImplementation 'org.assertj:assertj-core:3.8.0'
testImplementation 'junit:junit:4.12'
geolite2('org.elasticsearch:geolite2-databases:20191119') {
transitive = false
}
}
test {
exclude '/**'
}
tasks.register("unzipGeolite", Copy) {
from(zipTree(configurations.geolite2.singleFile)) {
include "GeoLite2-ASN.mmdb"
include "GeoLite2-City.mmdb"
}
into file("${projectDir}/spec/filters/geoip/vendor")
}
tasks.register("rubyTests", Test) {
dependsOn unzipGeolite
inputs.files fileTree("${projectDir}/spec")
inputs.files fileTree("${projectDir}/lib")
inputs.files fileTree("${projectDir}/modules")
systemProperty 'logstash.core.root.dir', projectDir.absolutePath
include '/org/logstash/xpack/test/RSpecTests.class'
}
tasks.register("rubyIntegrationTests", Test) {
if ((JavaVersion.current().getMajorVersion() as int) >= 17) {
jvmArgs = ['--add-opens', 'java.base/sun.nio.ch=ALL-UNNAMED', '--add-opens', 'java.base/java.io=ALL-UNNAMED']
}
dependsOn (":copyEs")
inputs.files fileTree("${projectDir}/qa")
inputs.files fileTree("${projectDir}/lib")
inputs.files fileTree("${projectDir}/modules")
systemProperty 'logstash.core.root.dir', projectDir.absolutePath
include '/org/logstash/xpack/test/RSpecIntegrationTests.class'
}