Skip to content

Commit dc1889c

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 e4cbf79 commit dc1889c

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
@@ -84,6 +84,26 @@ allprojects {
8484

8585
project.getExtensions().getExtraProperties().set("versions", VersionProperties.getVersions());
8686

87+
configurations {
88+
agent
89+
}
90+
91+
task prepareAgent(type: Copy) {
92+
from(configurations.agent)
93+
into "$buildDir/agent"
94+
}
95+
96+
dependencies {
97+
agent "org.opensearch:opensearch-agent-bootstrap:${opensearch_version}"
98+
agent "org.opensearch:opensearch-agent:${opensearch_version}"
99+
agent "net.bytebuddy:byte-buddy:${versions.bytebuddy}"
100+
}
101+
102+
tasks.withType(Test) {
103+
dependsOn prepareAgent
104+
jvmArgs += ["-javaagent:" + project.layout.buildDirectory.file("agent/opensearch-agent-${opensearch_version}.jar").get()]
105+
}
106+
87107
}
88108

89109
subprojects {

0 commit comments

Comments
 (0)