Skip to content

Commit e28ad36

Browse files
authored
Fixes ByteBuddy AbstractMethodError which could occur when running tests from IDE (#3327)
1 parent a40988e commit e28ad36

File tree

6 files changed

+46
-1
lines changed
  • apm-agent-attach-cli
  • apm-agent-plugins/apm-hibernate-search-plugin
    • apm-hibernate-search-plugin-5_x
    • apm-hibernate-search-plugin-6_x
  • apm-agent-tracer
  • elastic-apm-agent-premain

6 files changed

+46
-1
lines changed

apm-agent-attach-cli/pom.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@
5656
<version>${version.bouncy-castle.bc-fips}</version>
5757
<scope>provided</scope>
5858
</dependency>
59+
<dependency>
60+
<!-- required for the inherited assertJ and Mockito dependencies-->
61+
<groupId>net.bytebuddy</groupId>
62+
<artifactId>byte-buddy-dep</artifactId>
63+
<version>${version.byte-buddy}</version>
64+
<scope>test</scope>
65+
</dependency>
5966
</dependencies>
6067

6168
<build>

apm-agent-plugins/apm-hibernate-search-plugin/apm-hibernate-search-plugin-5_x/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@
2626
<artifactId>hibernate-search-orm</artifactId>
2727
<version>5.11.1.Final</version>
2828
<scope>provided</scope>
29+
<exclusions>
30+
<exclusion>
31+
<groupId>net.bytebuddy</groupId>
32+
<artifactId>byte-buddy</artifactId> <!-- conflicts with byte-buddy-dep -->
33+
</exclusion>
34+
</exclusions>
2935
</dependency>
3036

3137
<dependency>

apm-agent-plugins/apm-hibernate-search-plugin/apm-hibernate-search-plugin-6_x/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@
2828
<artifactId>hibernate-search-mapper-orm</artifactId>
2929
<version>${version.hibernate.search}</version>
3030
<scope>provided</scope>
31+
<exclusions>
32+
<exclusion>
33+
<groupId>net.bytebuddy</groupId>
34+
<artifactId>byte-buddy</artifactId> <!-- conflicts with byte-buddy-dep -->
35+
</exclusion>
36+
</exclusions>
3137
</dependency>
3238

3339
<dependency>

apm-agent-tracer/pom.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@
2424
<artifactId>apm-agent-common</artifactId>
2525
<version>${project.version}</version>
2626
</dependency>
27+
<dependency>
28+
<!-- required for the inherited assertJ and Mockito dependencies-->
29+
<groupId>net.bytebuddy</groupId>
30+
<artifactId>byte-buddy-dep</artifactId>
31+
<version>${version.byte-buddy}</version>
32+
<scope>test</scope>
33+
</dependency>
2734
</dependencies>
2835

2936
<build>

elastic-apm-agent-premain/pom.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@
2121
<artifactId>apm-agent-common</artifactId>
2222
<version>${project.version}</version>
2323
</dependency>
24+
<dependency>
25+
<!-- required for the inherited assertJ and Mockito dependencies-->
26+
<groupId>net.bytebuddy</groupId>
27+
<artifactId>byte-buddy-dep</artifactId>
28+
<version>${version.byte-buddy}</version>
29+
<scope>test</scope>
30+
</dependency>
2431
</dependencies>
2532

2633
</project>

pom.xml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,12 +721,24 @@
721721
<artifactId>assertj-core</artifactId>
722722
<version>3.24.2</version>
723723
<scope>test</scope>
724+
<exclusions>
725+
<exclusion>
726+
<groupId>net.bytebuddy</groupId>
727+
<artifactId>byte-buddy</artifactId> <!-- conflicts with byte-buddy-dep -->
728+
</exclusion>
729+
</exclusions>
724730
</dependency>
725731
<dependency>
726732
<groupId>org.mockito</groupId>
727733
<artifactId>mockito-core</artifactId>
728734
<version>${version.mockito}</version>
729735
<scope>test</scope>
736+
<exclusions>
737+
<exclusion>
738+
<groupId>net.bytebuddy</groupId>
739+
<artifactId>byte-buddy</artifactId> <!-- conflicts with byte-buddy-dep -->
740+
</exclusion>
741+
</exclusions>
730742
</dependency>
731743
<dependency>
732744
<!-- adding this to classpath allows to keep default behavior of mockito 4.x where mock subclassing is used. -->
@@ -756,7 +768,7 @@
756768
<dependency>
757769
<groupId>net.javacrumbs.json-unit</groupId>
758770
<artifactId>json-unit-assertj</artifactId>
759-
<version>2.37.0</version>
771+
<version>3.2.2</version>
760772
<scope>test</scope>
761773
</dependency>
762774
<dependency>

0 commit comments

Comments
 (0)