Skip to content

Commit 8020351

Browse files
committed
Fix build due to phasing off SecurityManager usage in favor of Java Agent
Signed-off-by: Andriy Redko <[email protected]>
1 parent 5e988e1 commit 8020351

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

build.gradle

+16
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ allprojects {
248248

249249
configurations {
250250
zipArchive
251+
agent
251252
}
252253

253254
publishing {
@@ -360,6 +361,10 @@ dependencies {
360361
// OpenSearch core is using slf4j 1.7.36. Therefore, we cannot change the version here.
361362
implementation 'org.slf4j:slf4j-api:1.7.36'
362363
zipArchive group: 'org.opensearch.plugin', name:'opensearch-security', version: "${opensearch_build}"
364+
365+
agent "org.opensearch:opensearch-agent-bootstrap:${opensearch_version}"
366+
agent "org.opensearch:opensearch-agent:${opensearch_version}"
367+
agent "net.bytebuddy:byte-buddy:${versions.bytebuddy}"
363368
}
364369

365370
task windowsPatches(type:Exec) {
@@ -610,3 +615,14 @@ task updateVersion {
610615
}
611616
}
612617
}
618+
619+
task prepareAgent(type: Copy) {
620+
from(configurations.agent)
621+
into "$buildDir/agent"
622+
}
623+
624+
tasks.withType(Test) {
625+
dependsOn prepareAgent
626+
jvmArgs += ["-javaagent:" + project.layout.buildDirectory.file("agent/opensearch-agent-${opensearch_version}.jar").get()]
627+
}
628+

0 commit comments

Comments
 (0)