Skip to content

Commit

Permalink
[pom] Add byte-buddy directly as a java agent (#1149)
Browse files Browse the repository at this point in the history
This resolves newer jdk 19+ that suggests they will block this in the future from dynamically adding.  Therefore this is no longer dynamically added both for lower jdks as well as jdk 17+
  • Loading branch information
hazendaz authored Jan 9, 2024
1 parent 1684d1a commit 4b5358a
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@
<project.build.resourceEncoding>UTF-8</project.build.resourceEncoding>
<maven.compile.encoding>UTF-8</maven.compile.encoding>

<byte-buddy.version>1.14.11</byte-buddy.version>
<jackson.version>2.16.0</jackson.version>
<junit.version>5.10.1</junit.version>

<test.integration.pattern>**/*IntegrationTest*.java</test.integration.pattern>

<!-- Surefire Setup -->
<argLine>-javaagent:${settings.localRepository}/net/bytebuddy/byte-buddy-agent/${byte-buddy.version}/byte-buddy-agent-${byte-buddy.version}.jar</argLine>
</properties>

<!-- 'oss-parent' should not be used, it was deprecated years ago -->
Expand Down Expand Up @@ -116,7 +120,7 @@
<jdk>[17,)</jdk>
</activation>
<properties>
<argLine>--add-opens java.base/java.io=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED</argLine>
<argLine>-javaagent:${settings.localRepository}/net/bytebuddy/byte-buddy-agent/${byte-buddy.version}/byte-buddy-agent-${byte-buddy.version}.jar --add-opens java.base/java.io=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED</argLine>
</properties>
</profile>
</profiles>
Expand Down Expand Up @@ -297,6 +301,18 @@
<version>5.8.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>${byte-buddy.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy-agent</artifactId>
<version>${byte-buddy.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-reflect</artifactId>
Expand Down

0 comments on commit 4b5358a

Please sign in to comment.