Skip to content

Commit d1d1264

Browse files
authored
Fix build due to phasing off SecurityManager usage in favor of Java Agent (opensearch-project#1450)
Signed-off-by: Pranav Reddy <[email protected]>
1 parent 4687dd3 commit d1d1264

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

build.gradle

+23
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,29 @@ allprojects {
211211
plugins.withId('jacoco') {
212212
jacoco.toolVersion = '0.8.12'
213213
}
214+
215+
configurations {
216+
agent
217+
}
218+
219+
dependencies {
220+
}
221+
222+
task prepareAgent(type: Copy) {
223+
from(configurations.agent)
224+
into "$buildDir/agent"
225+
}
226+
227+
dependencies {
228+
agent "org.opensearch:opensearch-agent-bootstrap:${opensearch_version}"
229+
agent "org.opensearch:opensearch-agent:${opensearch_version}"
230+
agent "net.bytebuddy:byte-buddy:${versions.bytebuddy}"
231+
}
232+
233+
tasks.withType(Test) {
234+
dependsOn prepareAgent
235+
jvmArgs += ["-javaagent:" + project.layout.buildDirectory.file("agent/opensearch-agent-${opensearch_version}.jar").get()]
236+
}
214237
}
215238

216239
java {

0 commit comments

Comments
 (0)