2015-10-29 14:40:19 -04:00
|
|
|
/*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2015-12-18 15:43:47 -05:00
|
|
|
|
2015-10-30 16:22:59 -04:00
|
|
|
import com.carrotsearch.gradle.junit4.RandomizedTestingTask
|
2015-10-29 14:40:19 -04:00
|
|
|
import org.elasticsearch.gradle.BuildPlugin
|
|
|
|
|
|
|
|
apply plugin: 'elasticsearch.build'
|
2016-03-18 20:22:25 -04:00
|
|
|
apply plugin: 'com.bmuschko.nexus'
|
2015-10-29 14:40:19 -04:00
|
|
|
apply plugin: 'nebula.optional-base'
|
2016-05-05 20:53:01 -04:00
|
|
|
apply plugin: 'nebula.maven-base-publish'
|
|
|
|
apply plugin: 'nebula.maven-scm'
|
|
|
|
|
|
|
|
publishing {
|
|
|
|
publications {
|
|
|
|
nebula {
|
|
|
|
artifactId 'elasticsearch'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2015-10-29 14:40:19 -04:00
|
|
|
|
2016-03-17 16:35:16 -04:00
|
|
|
archivesBaseName = 'elasticsearch'
|
2015-10-29 14:40:19 -04:00
|
|
|
|
|
|
|
dependencies {
|
|
|
|
|
|
|
|
// lucene
|
|
|
|
compile "org.apache.lucene:lucene-core:${versions.lucene}"
|
|
|
|
compile "org.apache.lucene:lucene-analyzers-common:${versions.lucene}"
|
2015-11-10 17:58:46 -05:00
|
|
|
compile "org.apache.lucene:lucene-backward-codecs:${versions.lucene}"
|
|
|
|
compile "org.apache.lucene:lucene-grouping:${versions.lucene}"
|
2015-10-29 14:40:19 -04:00
|
|
|
compile "org.apache.lucene:lucene-highlighter:${versions.lucene}"
|
|
|
|
compile "org.apache.lucene:lucene-join:${versions.lucene}"
|
2015-11-10 17:58:46 -05:00
|
|
|
compile "org.apache.lucene:lucene-memory:${versions.lucene}"
|
|
|
|
compile "org.apache.lucene:lucene-misc:${versions.lucene}"
|
|
|
|
compile "org.apache.lucene:lucene-queries:${versions.lucene}"
|
|
|
|
compile "org.apache.lucene:lucene-queryparser:${versions.lucene}"
|
|
|
|
compile "org.apache.lucene:lucene-sandbox:${versions.lucene}"
|
2015-10-29 14:40:19 -04:00
|
|
|
compile "org.apache.lucene:lucene-spatial:${versions.lucene}"
|
2016-03-07 04:12:23 -05:00
|
|
|
compile "org.apache.lucene:lucene-spatial-extras:${versions.lucene}"
|
2015-11-10 17:58:46 -05:00
|
|
|
compile "org.apache.lucene:lucene-spatial3d:${versions.lucene}"
|
|
|
|
compile "org.apache.lucene:lucene-suggest:${versions.lucene}"
|
2015-10-29 14:40:19 -04:00
|
|
|
|
|
|
|
compile 'org.elasticsearch:securesm:1.0'
|
|
|
|
|
|
|
|
// utilities
|
2016-07-07 02:50:10 -04:00
|
|
|
compile 'net.sf.jopt-simple:jopt-simple:5.0.2'
|
2015-10-29 14:40:19 -04:00
|
|
|
compile 'com.carrotsearch:hppc:0.7.1'
|
|
|
|
|
|
|
|
// time handling, remove with java 8 time
|
2016-05-27 08:51:19 -04:00
|
|
|
compile 'joda-time:joda-time:2.9.4'
|
2015-10-29 14:40:19 -04:00
|
|
|
// joda 2.0 moved to using volatile fields for datetime
|
|
|
|
// When updating to a new version, make sure to update our copy of BaseDateTime
|
|
|
|
compile 'org.joda:joda-convert:1.2'
|
|
|
|
|
|
|
|
// json and yaml
|
|
|
|
compile "com.fasterxml.jackson.core:jackson-core:${versions.jackson}"
|
|
|
|
compile "com.fasterxml.jackson.dataformat:jackson-dataformat-smile:${versions.jackson}"
|
2015-11-10 17:58:46 -05:00
|
|
|
compile "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:${versions.jackson}"
|
2015-10-29 14:40:19 -04:00
|
|
|
compile "com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:${versions.jackson}"
|
2015-11-10 17:58:46 -05:00
|
|
|
|
2015-10-29 14:40:19 -04:00
|
|
|
// network stack
|
2016-07-05 05:11:55 -04:00
|
|
|
compile 'io.netty:netty:3.10.6.Final'
|
2015-10-29 14:40:19 -04:00
|
|
|
// percentiles aggregation
|
|
|
|
compile 'com.tdunning:t-digest:3.0'
|
|
|
|
// precentil ranks aggregation
|
|
|
|
compile 'org.hdrhistogram:HdrHistogram:2.1.6'
|
|
|
|
|
|
|
|
// lucene spatial
|
2016-03-07 04:12:23 -05:00
|
|
|
compile "org.locationtech.spatial4j:spatial4j:${versions.spatial4j}", optional
|
2015-11-10 02:34:22 -05:00
|
|
|
compile "com.vividsolutions:jts:${versions.jts}", optional
|
2015-10-29 14:40:19 -04:00
|
|
|
|
|
|
|
// logging
|
|
|
|
compile "log4j:log4j:${versions.log4j}", optional
|
|
|
|
compile "log4j:apache-log4j-extras:${versions.log4j}", optional
|
|
|
|
|
2016-06-23 09:21:40 -04:00
|
|
|
compile "net.java.dev.jna:jna:${versions.jna}"
|
2015-10-29 14:40:19 -04:00
|
|
|
|
2015-11-20 14:58:50 -05:00
|
|
|
if (isEclipse == false || project.path == ":core-tests") {
|
2015-12-17 19:57:39 -05:00
|
|
|
testCompile("org.elasticsearch.test:framework:${version}") {
|
2015-11-05 01:28:57 -05:00
|
|
|
// tests use the locally compiled version of core
|
|
|
|
exclude group: 'org.elasticsearch', module: 'elasticsearch'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (isEclipse) {
|
|
|
|
// in eclipse the project is under a fake root, we need to change around the source sets
|
|
|
|
sourceSets {
|
2015-11-20 14:58:50 -05:00
|
|
|
if (project.path == ":core") {
|
2015-11-05 01:28:57 -05:00
|
|
|
main.java.srcDirs = ['java']
|
|
|
|
main.resources.srcDirs = ['resources']
|
|
|
|
} else {
|
|
|
|
test.java.srcDirs = ['java']
|
|
|
|
test.resources.srcDirs = ['resources']
|
|
|
|
}
|
2015-10-29 14:40:19 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-01-11 13:35:59 -05:00
|
|
|
compileJava.options.compilerArgs << "-Xlint:-cast,-deprecation,-rawtypes,-try,-unchecked"
|
|
|
|
compileTestJava.options.compilerArgs << "-Xlint:-cast,-deprecation,-rawtypes,-try,-unchecked"
|
2015-10-29 14:40:19 -04:00
|
|
|
|
|
|
|
forbiddenPatterns {
|
|
|
|
exclude '**/*.json'
|
|
|
|
exclude '**/*.jmx'
|
|
|
|
exclude '**/org/elasticsearch/cluster/routing/shard_routes.txt'
|
|
|
|
}
|
|
|
|
|
2016-05-25 16:31:04 -04:00
|
|
|
task generateModulesList {
|
|
|
|
List<String> modules = project(':modules').subprojects.collect { it.name }
|
|
|
|
File modulesFile = new File(buildDir, 'generated-resources/modules.txt')
|
|
|
|
processResources.from(modulesFile)
|
|
|
|
inputs.property('modules', modules)
|
|
|
|
outputs.file(modulesFile)
|
|
|
|
doLast {
|
|
|
|
modulesFile.parentFile.mkdirs()
|
|
|
|
modulesFile.setText(modules.join('\n'), 'UTF-8')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
task generatePluginsList {
|
|
|
|
List<String> plugins = project(':plugins').subprojects
|
|
|
|
.findAll { it.name.contains('example') == false }
|
|
|
|
.collect { it.name }
|
|
|
|
File pluginsFile = new File(buildDir, 'generated-resources/plugins.txt')
|
|
|
|
processResources.from(pluginsFile)
|
|
|
|
inputs.property('plugins', plugins)
|
|
|
|
outputs.file(pluginsFile)
|
|
|
|
doLast {
|
|
|
|
pluginsFile.parentFile.mkdirs()
|
|
|
|
pluginsFile.setText(plugins.join('\n'), 'UTF-8')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
processResources {
|
|
|
|
dependsOn generateModulesList, generatePluginsList
|
|
|
|
}
|
|
|
|
|
2015-12-16 16:38:16 -05:00
|
|
|
thirdPartyAudit.excludes = [
|
2015-12-28 22:38:55 -05:00
|
|
|
// uses internal java api: sun.security.x509 (X509CertInfo, X509CertImpl, X500Name)
|
|
|
|
'org.jboss.netty.handler.ssl.util.OpenJdkSelfSignedCertGenerator',
|
|
|
|
|
|
|
|
// classes are missing!
|
|
|
|
|
|
|
|
// from com.fasterxml.jackson.dataformat.yaml.YAMLMapper (jackson-dataformat-yaml)
|
|
|
|
'com.fasterxml.jackson.databind.ObjectMapper',
|
|
|
|
|
|
|
|
// from org.jboss.netty.handler.codec.protobuf.ProtobufVarint32FrameDecoder (netty)
|
|
|
|
'com.google.protobuf.CodedInputStream',
|
|
|
|
|
|
|
|
// from org.jboss.netty.handler.codec.protobuf.ProtobufVarint32LengthFieldPrepender (netty)
|
|
|
|
'com.google.protobuf.CodedOutputStream',
|
|
|
|
|
|
|
|
// from org.jboss.netty.handler.codec.protobuf.ProtobufDecoder (netty)
|
|
|
|
'com.google.protobuf.ExtensionRegistry',
|
|
|
|
'com.google.protobuf.MessageLite$Builder',
|
|
|
|
'com.google.protobuf.MessageLite',
|
|
|
|
'com.google.protobuf.Parser',
|
|
|
|
|
|
|
|
// from org.apache.log4j.receivers.net.JMSReceiver (log4j-extras)
|
|
|
|
'javax.jms.Message',
|
|
|
|
'javax.jms.MessageListener',
|
|
|
|
'javax.jms.ObjectMessage',
|
|
|
|
'javax.jms.TopicConnection',
|
|
|
|
'javax.jms.TopicConnectionFactory',
|
|
|
|
'javax.jms.TopicPublisher',
|
|
|
|
'javax.jms.TopicSession',
|
|
|
|
'javax.jms.TopicSubscriber',
|
|
|
|
|
|
|
|
// from org.apache.log4j.net.SMTPAppender (log4j)
|
|
|
|
'javax.mail.Authenticator',
|
|
|
|
'javax.mail.Message$RecipientType',
|
|
|
|
'javax.mail.Message',
|
|
|
|
'javax.mail.Multipart',
|
|
|
|
'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',
|
|
|
|
|
|
|
|
// from org.jboss.netty.channel.socket.http.HttpTunnelingServlet (netty)
|
|
|
|
'javax.servlet.ServletConfig',
|
|
|
|
'javax.servlet.ServletException',
|
|
|
|
'javax.servlet.ServletOutputStream',
|
|
|
|
'javax.servlet.http.HttpServlet',
|
|
|
|
'javax.servlet.http.HttpServletRequest',
|
|
|
|
'javax.servlet.http.HttpServletResponse',
|
|
|
|
|
|
|
|
// from org.jboss.netty.logging.CommonsLoggerFactory (netty)
|
|
|
|
'org.apache.commons.logging.Log',
|
|
|
|
'org.apache.commons.logging.LogFactory',
|
|
|
|
|
|
|
|
// from org.jboss.netty.handler.ssl.OpenSslEngine (netty)
|
|
|
|
'org.apache.tomcat.jni.Buffer',
|
|
|
|
'org.apache.tomcat.jni.Library',
|
|
|
|
'org.apache.tomcat.jni.Pool',
|
|
|
|
'org.apache.tomcat.jni.SSL',
|
|
|
|
'org.apache.tomcat.jni.SSLContext',
|
|
|
|
|
|
|
|
// from org.jboss.netty.handler.ssl.util.BouncyCastleSelfSignedCertGenerator (netty)
|
|
|
|
'org.bouncycastle.asn1.x500.X500Name',
|
|
|
|
'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 org.jboss.netty.handler.ssl.JettyNpnSslEngine (netty)
|
|
|
|
'org.eclipse.jetty.npn.NextProtoNego$ClientProvider',
|
|
|
|
'org.eclipse.jetty.npn.NextProtoNego$ServerProvider',
|
|
|
|
'org.eclipse.jetty.npn.NextProtoNego',
|
|
|
|
|
|
|
|
// from org.jboss.netty.logging.JBossLoggerFactory (netty)
|
|
|
|
'org.jboss.logging.Logger',
|
|
|
|
|
|
|
|
// from org.jboss.netty.handler.codec.marshalling.ChannelBufferByteInput (netty)
|
|
|
|
'org.jboss.marshalling.ByteInput',
|
|
|
|
|
|
|
|
// from org.jboss.netty.handler.codec.marshalling.ChannelBufferByteOutput (netty)
|
|
|
|
'org.jboss.marshalling.ByteOutput',
|
|
|
|
|
|
|
|
// from org.jboss.netty.handler.codec.marshalling.CompatibleMarshallingEncoder (netty)
|
|
|
|
'org.jboss.marshalling.Marshaller',
|
|
|
|
|
|
|
|
// from org.jboss.netty.handler.codec.marshalling.ContextBoundUnmarshallerProvider (netty)
|
|
|
|
'org.jboss.marshalling.MarshallerFactory',
|
|
|
|
'org.jboss.marshalling.MarshallingConfiguration',
|
|
|
|
'org.jboss.marshalling.Unmarshaller',
|
|
|
|
|
2016-03-07 04:12:23 -05:00
|
|
|
// from org.locationtech.spatial4j.io.GeoJSONReader (spatial4j)
|
2015-12-28 22:38:55 -05:00
|
|
|
'org.noggit.JSONParser',
|
|
|
|
|
|
|
|
// from org.jboss.netty.container.osgi.NettyBundleActivator (netty)
|
|
|
|
'org.osgi.framework.BundleActivator',
|
|
|
|
'org.osgi.framework.BundleContext',
|
|
|
|
|
|
|
|
// from org.jboss.netty.logging.OsgiLoggerFactory$1 (netty)
|
|
|
|
'org.osgi.framework.ServiceReference',
|
|
|
|
'org.osgi.service.log.LogService',
|
|
|
|
'org.osgi.util.tracker.ServiceTracker',
|
|
|
|
'org.osgi.util.tracker.ServiceTrackerCustomizer',
|
|
|
|
|
2016-02-16 08:46:03 -05:00
|
|
|
// from org.netty.util.internal.logging.InternalLoggerFactory (netty) - it's optional
|
|
|
|
'org.slf4j.Logger',
|
|
|
|
'org.slf4j.LoggerFactory',
|
2015-12-16 16:38:16 -05:00
|
|
|
]
|
|
|
|
|
2015-12-01 20:08:27 -05:00
|
|
|
// dependency license are currently checked in distribution
|
|
|
|
dependencyLicenses.enabled = false
|
|
|
|
|
2015-11-20 14:58:50 -05:00
|
|
|
if (isEclipse == false || project.path == ":core-tests") {
|
2015-11-05 01:28:57 -05:00
|
|
|
task integTest(type: RandomizedTestingTask,
|
|
|
|
group: JavaBasePlugin.VERIFICATION_GROUP,
|
|
|
|
description: 'Multi-node tests',
|
|
|
|
dependsOn: test.dependsOn) {
|
|
|
|
configure(BuildPlugin.commonTestConfig(project))
|
|
|
|
classpath = project.test.classpath
|
|
|
|
testClassesDir = project.test.testClassesDir
|
|
|
|
include '**/*IT.class'
|
|
|
|
}
|
|
|
|
check.dependsOn integTest
|
|
|
|
integTest.mustRunAfter test
|
|
|
|
}
|