2018-01-20 00:30:17 -05:00
|
|
|
import org.elasticsearch.gradle.MavenFilteringHack
|
2020-01-27 16:48:40 -05:00
|
|
|
import org.elasticsearch.gradle.info.BuildParams
|
2018-01-20 00:30:17 -05:00
|
|
|
|
2018-01-21 10:00:47 -05:00
|
|
|
import java.nio.file.Files
|
2018-04-03 13:45:07 -04:00
|
|
|
import java.nio.file.Paths
|
2018-01-21 10:00:47 -05:00
|
|
|
|
2018-01-20 00:30:17 -05:00
|
|
|
apply plugin: 'elasticsearch.esplugin'
|
2018-07-19 04:53:08 -04:00
|
|
|
apply plugin: 'nebula.maven-base-publish'
|
2020-05-12 00:06:04 -04:00
|
|
|
apply plugin: 'elasticsearch.internal-cluster-test'
|
2018-01-23 01:58:34 -05:00
|
|
|
|
|
|
|
archivesBaseName = 'x-pack-core'
|
|
|
|
|
2018-01-20 00:30:17 -05:00
|
|
|
esplugin {
|
|
|
|
name 'x-pack-core'
|
|
|
|
description 'Elasticsearch Expanded Pack Plugin - Core'
|
2018-01-23 13:43:58 -05:00
|
|
|
classname 'org.elasticsearch.xpack.core.XPackPlugin'
|
2018-01-21 11:00:51 -05:00
|
|
|
hasNativeController false
|
2018-01-25 08:33:30 -05:00
|
|
|
requiresKeystore false
|
2018-01-20 00:30:17 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencyLicenses {
|
|
|
|
mapping from: /http.*/, to: 'httpclient' // pulled in by rest client
|
|
|
|
mapping from: /commons-.*/, to: 'commons' // pulled in by rest client
|
|
|
|
}
|
2017-12-08 11:41:32 -05:00
|
|
|
|
|
|
|
dependencies {
|
2019-11-14 06:01:23 -05:00
|
|
|
compileOnly project(":server")
|
2019-11-28 23:01:20 -05:00
|
|
|
compile project(":libs:elasticsearch-ssl-config")
|
2019-11-14 06:01:23 -05:00
|
|
|
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}"
|
|
|
|
|
|
|
|
// 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
|
|
|
|
}
|
2019-10-03 03:50:46 -04:00
|
|
|
|
2018-01-20 00:30:17 -05:00
|
|
|
}
|
|
|
|
|
2018-01-23 01:58:34 -05:00
|
|
|
ext.expansions = [
|
|
|
|
'project.version': version
|
|
|
|
]
|
|
|
|
|
2018-01-20 00:30:17 -05:00
|
|
|
processResources {
|
|
|
|
from(sourceSets.main.resources.srcDirs) {
|
|
|
|
exclude '**/public.key'
|
|
|
|
inputs.properties(expansions)
|
|
|
|
MavenFilteringHack.filter(it, expansions)
|
|
|
|
}
|
2018-03-21 01:06:05 -04:00
|
|
|
String licenseKey = System.getProperty("license.key")
|
|
|
|
if (licenseKey != null) {
|
|
|
|
println "Using provided license key from ${licenseKey}"
|
2020-01-27 16:48:40 -05:00
|
|
|
} else if (BuildParams.isSnapshotBuild()) {
|
2019-11-14 06:01:23 -05:00
|
|
|
licenseKey = Paths.get(project.projectDir.path, 'snapshot.key')
|
2018-01-20 00:30:17 -05:00
|
|
|
} else {
|
2018-03-21 01:06:05 -04:00
|
|
|
throw new IllegalArgumentException('Property license.key must be set for release build')
|
|
|
|
}
|
2018-04-03 13:45:07 -04:00
|
|
|
if (Files.exists(Paths.get(licenseKey)) == false) {
|
|
|
|
throw new IllegalArgumentException('license.key at specified path [' + licenseKey + '] does not exist')
|
|
|
|
}
|
2018-03-21 01:06:05 -04:00
|
|
|
from(licenseKey) {
|
|
|
|
rename { String filename -> 'public.key' }
|
2018-01-20 00:30:17 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
forbiddenPatterns {
|
2019-11-14 06:01:23 -05:00
|
|
|
exclude '**/*.key'
|
|
|
|
exclude '**/*.p12'
|
|
|
|
exclude '**/*.der'
|
|
|
|
exclude '**/*.zip'
|
2017-12-08 11:41:32 -05:00
|
|
|
}
|
|
|
|
|
2020-04-15 16:23:55 -04:00
|
|
|
tasks.named('forbiddenApisMain').configure {
|
2019-11-14 06:01:23 -05:00
|
|
|
signaturesFiles += files('forbidden/hasher-signatures.txt')
|
2019-05-22 01:20:51 -04:00
|
|
|
}
|
|
|
|
|
2019-04-05 02:01:56 -04:00
|
|
|
compileJava.options.compilerArgs << "-Xlint:-rawtypes,-unchecked"
|
|
|
|
compileTestJava.options.compilerArgs << "-Xlint:-rawtypes,-unchecked"
|
2017-12-27 11:31:16 -05:00
|
|
|
|
|
|
|
licenseHeaders {
|
|
|
|
approvedLicenses << 'BCrypt (BSD-like)'
|
|
|
|
additionalLicense 'BCRYP', 'BCrypt (BSD-like)', 'Copyright (c) 2006 Damien Miller <djm@mindrot.org>'
|
2018-05-29 12:11:09 -04:00
|
|
|
excludes << 'org/elasticsearch/xpack/core/ssl/DerParser.java'
|
2018-01-20 00:30:17 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// make LicenseSigner available for testing signed licenses
|
2019-04-08 10:05:12 -04:00
|
|
|
sourceSets.test.resources {
|
2019-11-14 06:01:23 -05:00
|
|
|
srcDir 'src/main/config'
|
2018-01-20 00:30:17 -05:00
|
|
|
}
|
|
|
|
|
2019-04-09 14:52:50 -04:00
|
|
|
test {
|
2019-11-14 06:01:23 -05:00
|
|
|
/*
|
|
|
|
* 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'
|
2018-01-20 00:30:17 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// TODO: don't publish test artifacts just to run messy tests, fix the tests!
|
|
|
|
// https://github.com/elastic/x-plugins/issues/724
|
|
|
|
configurations {
|
2019-11-14 06:01:23 -05:00
|
|
|
testArtifacts.extendsFrom testRuntime
|
2018-01-20 00:30:17 -05:00
|
|
|
}
|
|
|
|
task testJar(type: Jar) {
|
2019-11-14 06:01:23 -05:00
|
|
|
appendix 'test'
|
|
|
|
from sourceSets.test.output
|
2018-01-20 00:30:17 -05:00
|
|
|
}
|
2018-07-20 17:03:58 -04:00
|
|
|
|
2018-01-20 00:30:17 -05:00
|
|
|
artifacts {
|
2019-11-14 06:01:23 -05:00
|
|
|
// 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
|
2018-01-20 00:30:17 -05:00
|
|
|
}
|
|
|
|
|
2019-11-14 06:01:23 -05:00
|
|
|
thirdPartyAudit.ignoreMissingClasses(
|
2018-01-23 01:58:34 -05:00
|
|
|
//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'
|
2019-01-07 10:24:19 -05:00
|
|
|
)
|
2018-01-25 04:38:34 -05:00
|
|
|
|
|
|
|
// xpack modules are installed in real clusters as the meta plugin, so
|
|
|
|
// installing them as individual plugins for integ tests doesn't make sense,
|
2018-12-05 07:20:01 -05:00
|
|
|
// so we disable integ tests
|
2018-01-25 04:38:34 -05:00
|
|
|
integTest.enabled = false
|
2018-12-05 07:20:01 -05:00
|
|
|
|