Skip to content

Commit 2805580

Browse files
committed
Fix build due to phasing off SecurityManager usage in favor of Java Agent
Signed-off-by: Pranav Reddy <pranavrd@amazon.com>
1 parent cf50bff commit 2805580

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

build.gradle

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,26 @@ allprojects {
179179
plugins.withId('java') {
180180
sourceCompatibility = targetCompatibility = "21"
181181
}
182+
183+
configurations {
184+
agent
185+
}
186+
187+
task prepareAgent(type: Copy) {
188+
from(configurations.agent)
189+
into "$buildDir/agent"
190+
}
191+
192+
dependencies {
193+
agent "org.opensearch:opensearch-agent-bootstrap:${opensearch_version}"
194+
agent "org.opensearch:opensearch-agent:${opensearch_version}"
195+
agent "net.bytebuddy:byte-buddy:${versions.bytebuddy}"
196+
}
197+
198+
tasks.withType(Test) {
199+
dependsOn prepareAgent
200+
jvmArgs += ["-javaagent:" + project.layout.buildDirectory.file("agent/opensearch-agent-${opensearch_version}.jar").get()]
201+
}
182202
}
183203

184204
dependencies {

0 commit comments

Comments
 (0)