elasticsearch/plugins/examples/security-authorization-engine/build.gradle
Mariusz Józala d4045e2152
[Test] Use version range for elasticsearch-java (#127398)
Snapshot builds of elasticsearch-java are no longer available.
Using the current major highest version should be safe according to the
compatibility guarantees described on https://github.com/elastic/elasticsearch-java?tab=readme-ov-file#compatibility

Repo https://snapshots.elastic.co/maven/ is no longer needed in a
composite build. Previously it was only used to provide snapshot version
 of `elasticsearch-java` client which is no longer available in snapshot
  version. We keep the https://snapshots.elastic.co/maven/ repo to be
  used when for non-composite builds when any other dependencies
  snapshot versions can be fetched.
2025-05-05 13:58:17 +02:00

41 lines
1.8 KiB
Groovy

apply plugin: 'elasticsearch.esplugin'
apply plugin: 'elasticsearch.java-rest-test'
esplugin {
name = 'security-authorization-engine'
description = 'An example spi extension plugin for security that implements an Authorization Engine'
classname ='org.elasticsearch.example.AuthorizationEnginePlugin'
extendedPlugins = ['x-pack-security']
licenseFile = layout.settingsDirectory.file('AGPL-3.0+SSPL-1.0+ELASTIC-LICENSE-2.0.txt').asFile
noticeFile = layout.settingsDirectory.file('NOTICE.txt').asFile
}
dependencies {
compileOnly "org.elasticsearch.plugin:x-pack-core:${elasticsearchVersion}"
testImplementation "org.apache.logging.log4j:log4j-core:${log4jVersion}"
testImplementation "org.elasticsearch.plugin:x-pack-core:${elasticsearchVersion}"
javaRestTestImplementation "org.elasticsearch.plugin:x-pack-core:${elasticsearchVersion}"
javaRestTestImplementation "org.apache.logging.log4j:log4j-core:${log4jVersion}"
javaRestTestImplementation "co.elastic.clients:elasticsearch-java:[9.0,10.0)"
javaRestTestImplementation "org.elasticsearch.client:elasticsearch-rest-client:${elasticsearchVersion}"
javaRestTestImplementation 'com.fasterxml.jackson.core:jackson-databind:2.12.3'
javaRestTestImplementation "org.elasticsearch.test:framework:${elasticsearchVersion}"
}
tasks.named("javaRestTest").configure {
systemProperty 'tests.security.manager', 'false'
}
testClusters.matching { it.name == "javaRestTest" }.configureEach {
setting 'xpack.security.enabled', 'true'
setting 'xpack.ml.enabled', 'false'
setting 'xpack.license.self_generated.type', 'trial'
// This is important, so that all the modules are available too.
// There are index templates that use token filters that are in analysis-module and
// processors are being used that are in ingest-common module.
testDistribution = 'DEFAULT'
user role: 'custom_superuser'
}