Skip to content

Commit aeaf807

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 aeaf807

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

build.gradle

+24
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,29 @@ allprojects {
244244
project.noticeFile = rootProject.file('NOTICE.txt')
245245
project.forbiddenApis.ignoreFailures = true
246246
}
247+
248+
configurations {
249+
agent
250+
}
251+
252+
dependencies {
253+
}
254+
255+
task prepareAgent(type: Copy) {
256+
from(configurations.agent)
257+
into "$buildDir/agent"
258+
}
259+
260+
dependencies {
261+
agent "org.opensearch:opensearch-agent-bootstrap:${opensearch_version}"
262+
agent "org.opensearch:opensearch-agent:${opensearch_version}"
263+
agent "net.bytebuddy:byte-buddy:${versions.bytebuddy}"
264+
}
265+
266+
tasks.withType(Test) {
267+
dependsOn prepareAgent
268+
jvmArgs += ["-javaagent:" + project.layout.buildDirectory.file("agent/opensearch-agent-${opensearch_version}.jar").get()]
269+
}
247270
}
248271

249272
configurations {
@@ -610,3 +633,4 @@ task updateVersion {
610633
}
611634
}
612635
}
636+

0 commit comments

Comments
 (0)