Add Shadow jar publication to lang-painless module. (#2681)

* Add Shadow jar publication to lang-painless module.

This change creates a shadow jar for asm dependencies so
that they do not conflict with direct asm dependencies from log4j AL2 patch.

Signed-off-by: Marc Handalian <handalm@amazon.com>

* Remove security.manager systemProperty that is not required.

Signed-off-by: Marc Handalian <handalm@amazon.com>

* Add explicit task dependency for publishing to maven local required by gradle.

Signed-off-by: Marc Handalian <handalm@amazon.com>

* Move asm dependencies back to api scope.

Signed-off-by: Marc Handalian <handalm@amazon.com>
This commit is contained in:
Marc Handalian 2022-04-01 13:40:42 -07:00 committed by GitHub
parent 86eb24d27f
commit d7d41085f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 2 deletions

View File

@ -29,8 +29,11 @@
*/
import org.opensearch.gradle.testclusters.DefaultTestClustersTask;
import com.github.jengelman.gradle.plugins.shadow.ShadowBasePlugin
apply plugin: 'opensearch.validate-rest-spec'
apply plugin: 'opensearch.yaml-rest-test'
apply plugin: 'com.github.johnrengelman.shadow'
opensearchplugin {
description 'An easy, safe and fast scripting language for OpenSearch'
@ -49,11 +52,36 @@ dependencies {
api 'org.ow2.asm:asm-util:9.2'
api 'org.ow2.asm:asm-tree:9.2'
api 'org.ow2.asm:asm-commons:9.2'
api 'org.ow2.asm:asm-analysis:7.2'
api 'org.ow2.asm:asm-analysis:9.2'
api 'org.ow2.asm:asm:9.2'
api project('spi')
}
test {
doFirst {
test.classpath -= project.files(project.tasks.named('shadowJar'))
test.classpath -= project.configurations.getByName(ShadowBasePlugin.CONFIGURATION_NAME)
test.classpath += project.extensions.getByType(SourceSetContainer).getByName(SourceSet.MAIN_SOURCE_SET_NAME).runtimeClasspath
}
}
shadowJar {
classifier = null
relocate 'org.objectweb', 'org.opensearch.repackage.org.objectweb'
dependencies {
include(dependency('org.ow2.asm:asm:9.2'))
include(dependency('org.ow2.asm:asm-util:9.2'))
include(dependency('org.ow2.asm:asm-tree:9.2'))
include(dependency('org.ow2.asm:asm-commons:9.2'))
include(dependency('org.ow2.asm:asm-analysis:9.2'))
}
}
tasks.validateNebulaPom.dependsOn tasks.generatePomFileForShadowPublication
tasks.validateShadowPom.dependsOn tasks.generatePomFileForNebulaPublication
tasks.publishNebulaPublicationToMavenLocal.dependsOn tasks.generatePomFileForShadowPublication
tasks.publishShadowPublicationToMavenLocal.dependsOn tasks.generatePomFileForNebulaPublication
tasks.named("dependencyLicenses").configure {
mapping from: /asm-.*/, to: 'asm'
}

View File

@ -1 +0,0 @@
b6e6abe057f23630113f4167c34bda7086691258

View File

@ -0,0 +1 @@
7487dd756daf96cab9986e44b9d7bcb796a61c10