Skip to content

Commit d6ddd5b

Browse files
authored
Fix build due to phasing off SecurityManager usage in favor of Java Agent (opensearch-project#1504)
1 parent f6a9036 commit d6ddd5b

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
@@ -138,6 +138,26 @@ allprojects {
138138
targetCompatibility = JavaVersion.VERSION_21
139139
sourceCompatibility = JavaVersion.VERSION_21
140140
}
141+
142+
configurations {
143+
agent
144+
}
145+
146+
task prepareAgent(type: Copy) {
147+
from(configurations.agent)
148+
into "$buildDir/agent"
149+
}
150+
151+
dependencies {
152+
agent "org.opensearch:opensearch-agent-bootstrap:${opensearch_version}"
153+
agent "org.opensearch:opensearch-agent:${opensearch_version}"
154+
agent "net.bytebuddy:byte-buddy:${versions.bytebuddy}"
155+
}
156+
157+
tasks.withType(Test) {
158+
dependsOn prepareAgent
159+
jvmArgs += ["-javaagent:" + project.layout.buildDirectory.file("agent/opensearch-agent-${opensearch_version}.jar").get()]
160+
}
141161
}
142162

143163
publishing {

0 commit comments

Comments
 (0)