From bb71c63853ecbcda0d893d2874d7cdc3d360db99 Mon Sep 17 00:00:00 2001 From: Sanne Grinovero Date: Thu, 12 Jul 2018 12:32:01 +0100 Subject: [PATCH] HHH-12799 Enforce version alignment of Mockito and ByteBuddy dependencies --- gradle/libraries.gradle | 9 +++++++++ 1 file changed, 9 insertions(+) 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 + } + } +}