@mockitoguy might be able to provide more insight, but I think we create our Jar on this line: https://github.com/mockito/mockito/blob/78b22fcf814c33e87585afed387cd9db0b6d36a5/gradle/java-publication.gradle#L32

We would welcome PRs for this issue. Hopefully the link provides enough context to figure out how to resolve the problem? The commit message for fde5abb includes [ci maven-central-release] - should this cause a release to be published to maven central?
I can't see a new release there at the moment, not sure if there is usually a delay? It should have, but it seems like it incorrectly concluded it didn't include the message. Filed #2110 On it.
JarInputStream fails to get Manifest from published mockito-core
Using mockito-core in a JPMS based gradle build fails due to a known but odd behaviour of JarInputStream. The latter only provides access to the Jar's manifest if it is the 1st or 2nd entry in the Jar. As discussed in:

* https://bugs.openjdk.java.net/browse/JDK-8031748
* https://bugs.openjdk.java.net/browse/JDK-8211917

As gradle uses the JarInputStream to get the manifest and to determine whether the Automatic-Module-Name attribute is set, it fails to add mockito-core to the module path (see GRADLE [#15270](https://github.com/gradle/gradle/issues/15270). Same issue was observed for Quarkus [#5399](https://github.com/quarkusio/quarkus/issues/5399). The attached example code [example.zip](https://github.com/mockito/mockito/files/5585881/example.zip) shows this issue.

An optimal solution would be to make sure the manifest file is kept at the Jar's beginning during the publication process.

Used versions:
* mockito-core-3.6.0.jar
* java version "11.0.6" 2020-01-14 LTS 
Java(TM) SE Runtime Environment 18.9 (build 11.0.6+8-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.6+8-LTS, mixed mode)

gradle/mockito-core/osgi.gradle
gradle/mockito-core/osgi.gradle
diff --git a/gradle/mockito-core/osgi.gradle b/gradle/mockito-core/osgi.gradle
index f44ea9c18b..2fa0b78354 100644
--- a/gradle/mockito-core/osgi.gradle
+++ b/gradle/mockito-core/osgi.gradle
@@ -71,7 +71,8 @@ class RemoveOsgiLastModifiedHeader {
 
             this.artifact
                 .entries()
-                .sort { it.name }
+                // Keep META-INF folder at the beginning to avoid https://github.com/mockito/mockito/issues/2108
+                .sort { (it.name.startsWith("META-INF") ? "A/" + it.name : "B/" + it.name) }
                 .each { JarEntry entry ->
 
                     stream.putNextEntry(newJarEntry(entry))
