Skip to content

Commit

Permalink
Mockito 5 usage in OSGi env (#2004)
Browse files Browse the repository at this point in the history
Allows the usage of Mockito 5 in OSGi environment.

This changes the version range from `[4.11,5)` to `[4.11,6)` for the
Mockito import packages.
  • Loading branch information
AndreasTu authored Sep 24, 2024
1 parent fd66b01 commit 8a834a2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions spock-core/core.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ dependencies {
if (variant == 2.5) {
api projects.spockGroovy2Compat
}

implementation libs.geantyref

compileOnly libs.jetbrains.annotations
Expand Down Expand Up @@ -69,7 +69,10 @@ tasks.named("jar", Jar) {
'net.bytebuddy.*;resolution:=optional',
'net.sf.cglib.*;resolution:=optional',
'org.objectweb.asm.*;resolution:=optional',
'org.mockito.*;resolution:=optional',
/* We need to override the OSGi version for Mockito here, otherwise the version range would be [4.11,5)
* which would exclude Mockito 5 in the OSGi case.
*/
'org.mockito.*;resolution:=optional;version="[4.11,6)"',
'*'
].join(','),
'-noclassforname': 'true',
Expand Down

0 comments on commit 8a834a2

Please sign in to comment.