OpenSearch/x-pack/plugin/sql/jdbc/build.gradle

96 lines
2.4 KiB
Groovy
Raw Normal View History

buildscript {
repositories {
maven {
url 'https://plugins.gradle.org/m2/'
}
}
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.2'
}
}
apply plugin: 'elasticsearch.build'
apply plugin: 'nebula.maven-base-publish'
apply plugin: 'nebula.maven-scm'
apply plugin: 'com.github.johnrengelman.shadow'
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
signaturesURLs = [this.class.getResource('/forbidden/jdk-signatures.txt')]
}
dependencies {
compile (xpackProject('plugin:sql:sql-shared-client')) {
transitive = false
}
compile (xpackProject('plugin:sql:sql-shared-proto')) {
transitive = false
}
compile (project(':libs:x-content')) {
transitive = false
}
compile project(':libs:core')
runtime "com.fasterxml.jackson.core:jackson-core:${versions.jackson}"
testCompile "org.elasticsearch.test:framework:${version}"
}
dependencyLicenses {
mapping from: /sql-shared-proto.*/, to: 'elasticsearch'
mapping from: /sql-shared-client.*/, to: 'elasticsearch'
mapping from: /jackson-.*/, to: 'jackson'
mapping from: /elasticsearch-core.*/, to: 'elasticsearch'
ignoreSha 'sql-shared-proto'
ignoreSha 'sql-shared-client'
ignoreSha 'elasticsearch'
}
shadowJar {
classifier = null
relocate 'com.fasterxml', 'org.elasticsearch.fasterxml'
}
// We don't need normal jar, we use shadow jar instead
jar.enabled = false
// We need a no-depenencies jar though for qa testing so it doesn't conflict with cli
configurations {
nodeps
}
task nodepsJar(type: Jar) {
appendix 'nodeps'
from sourceSets.main.output
}
artifacts {
nodeps nodepsJar
archives shadowJar
}
publishing {
publications {
nebula(MavenPublication) {
artifact shadowJar
pom.withXml {
// Nebula is mistakenly including all dependencies that are already shadowed into the shadow jar
asNode().remove(asNode().dependencies)
}
}
}
}
assemble.dependsOn shadowJar
// Use the jar for testing so the tests are more "real"
test {
classpath -= compileJava.outputs.files
classpath -= configurations.compile
classpath -= configurations.runtime
classpath += shadowJar.outputs.files
dependsOn shadowJar
}