diff --git a/gradle/libraries.gradle b/gradle/libraries.gradle index 149b913f81..2ae19b3d82 100644 --- a/gradle/libraries.gradle +++ b/gradle/libraries.gradle @@ -159,3 +159,12 @@ ext { jboss_annotation_spec_jar : 'org.jboss.spec.javax.annotation:jboss-annotations-api_1.2_spec:1.0.0.Final' ] } + +configurations.all { + resolutionStrategy.eachDependency { DependencyResolveDetails details -> + //Force the "byte buddy agent" version to match the Byte Buddy version we use, as Mockito might pull in a mismatched version transitively: + if (details.requested.group + ":" + details.requested.name == 'net.bytebuddy:byte-buddy-agent') { + details.useVersion byteBuddyVersion + } + } +}