Skip to content

Commit 25e52af

Browse files
authored
Support phasing off SecurityManager usage in favor of Java Agent (#814)
Signed-off-by: Gulshan <[email protected]>
1 parent 80660a5 commit 25e52af

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

build.gradle

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ configurations {
7272
force "ch.qos.logback:logback-core:1.5.16"
7373
}
7474
}
75+
agent
7576
}
7677

7778
dependencies {
@@ -91,6 +92,10 @@ dependencies {
9192
testImplementation "commons-validator:commons-validator:1.7"
9293
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.2'
9394

95+
agent "org.opensearch:opensearch-agent-bootstrap:${opensearch_version}"
96+
agent "org.opensearch:opensearch-agent:${opensearch_version}"
97+
agent "net.bytebuddy:byte-buddy:1.17.5"
98+
9499
ktlint "com.pinterest:ktlint:0.47.1"
95100
}
96101

@@ -232,3 +237,13 @@ task updateVersion {
232237
ant.replaceregexp(file:'build.gradle', match: '"opensearch.version", "\\d.*"', replace: '"opensearch.version", "' + newVersion.tokenize('-')[0] + '-SNAPSHOT"', flags:'g', byline:true)
233238
}
234239
}
240+
241+
task prepareAgent(type: Copy) {
242+
from(configurations.agent)
243+
into "$buildDir/agent"
244+
}
245+
246+
tasks.withType(Test) {
247+
dependsOn prepareAgent
248+
jvmArgs += ["-javaagent:" + project.layout.buildDirectory.file("agent/opensearch-agent-${opensearch_version}.jar").get()]
249+
}

0 commit comments

Comments
 (0)