Skip to content

Commit 618dba7

Browse files
Support phasing off SecurityManager usage in favor of Java Agent (opensearch-project#156)
Signed-off-by: Peter Zhu <[email protected]>
1 parent f8a3344 commit 618dba7

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

build.gradle

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ repositories {
118118
maven { url "https://plugins.gradle.org/m2/" }
119119
}
120120

121+
configurations {
122+
agent
123+
}
124+
121125
dependencies {
122126
implementation "org.apache.lucene:lucene-expressions:${luceneVersion}"
123127
implementation "org.antlr:antlr4-runtime:${antlrVersion}"
@@ -137,6 +141,10 @@ dependencies {
137141
runtimeOnly 'org.locationtech.spatial4j:spatial4j:0.7'
138142
runtimeOnly 'org.locationtech.jts:jts-core:1.15.0'
139143
runtimeOnly 'org.apache.logging.log4j:log4j-core:2.21.0'
144+
145+
agent "org.opensearch:opensearch-agent-bootstrap:${opensearch_version}"
146+
agent "org.opensearch:opensearch-agent:${opensearch_version}"
147+
agent "net.bytebuddy:byte-buddy:${versions.bytebuddy}"
140148
}
141149

142150
configurations.all {
@@ -248,6 +256,16 @@ tasks.withType(Test).configureEach { task ->
248256
}
249257
}
250258

259+
task prepareAgent(type: Copy) {
260+
from(configurations.agent)
261+
into "$buildDir/agent"
262+
}
263+
264+
tasks.withType(Test) {
265+
dependsOn prepareAgent
266+
jvmArgs += ["-javaagent:" + project.layout.buildDirectory.file("agent/opensearch-agent-${opensearch_version}.jar").get()]
267+
}
268+
251269
tasks.named('dependencyLicenses') {
252270
enabled = false
253271
}
@@ -274,4 +292,4 @@ run {
274292
}
275293
}
276294
useCluster testClusters.integTest
277-
}
295+
}

0 commit comments

Comments
 (0)