If we can make this work on JDK6-8, I am all for it. If you can, please submit a PR that we can review :) This change is compatible with JDK6-8, because you only add an entry to `MANIFEST.mf` file. Older Java versions simply ignore it, and JDK9 uses it as a stable automatic module name (instead of generating it from JAR archive name).

If you drop the support for older JDKs somewhere in the future, you can create a true module with the same name and the change will be invisible to JDK9 modular applications:

```java
module org.mockito {
   requires ...;
}
```

PR -> I'd love to, but I'm tracking the Jigsaw support in more projects and I'm afraid I don't have enough time to update them all. So I will see.
JDK9: set a stable module name with `Automatic-Module-Name` entry in MANIFEST
JDK9 is out and introduces a module system.

Mockito does not currently use modules. When we use it in a JDK9 modular application, Java turns the JAR into a so-called automatic module, whose name is derived from the JAR archive name (*mockito*, in this case). However, the default name does not follow the recommended module naming conventions (reverse-dns style, module name derived from the main exported package).

It is possible to specify a stable automatic module name through a `Automatic-Module-Name` manifest entry, while still targeting JDK8:

```
Automatic-Module-Name: org.mockito
```

Selecting a stable module name is very important, because Java does not allow two modules to own the same package, and you may end up with a module hell. The naming issues are well-explained on Stephen Colebourne's blog:

 * http://blog.joda.org/2017/04/java-se-9-jpms-module-naming.html
 * http://blog.joda.org/2017/05/java-se-9-jpms-automatic-modules.html <- the explanation of module hell problem

And the comment of Mike Reinhold, chief Java architect:

> Strongly recommend that all modules be named according to the reverse Internet domain-name convention. A module's name should correspond to the name of its principal exported API package, which should also follow that convention. If a module does not have such a package, or if for legacy reasons it must have a name that does not correspond to one of its exported packages, then its name should at least start with the reversed form of an Internet domain with which the author is associated.
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 2b0eb65fee..90a32eb6f8 100644
--- a/gradle/mockito-core/osgi.gradle
+++ b/gradle/mockito-core/osgi.gradle
@@ -27,6 +27,8 @@ afterEvaluate {
                     'org.mockito.*'
 
             instruction '-removeheaders', 'Private-Package'
+
+            attributes 'Automatic-Module-Name': 'org.mockito'
         }
     }
 }
