Skip to content

Consider adding module-info.class #2604

@ascopes

Description

@ascopes

Would it be possible to bundle a Java-9-compiled module-info.class in with mockito-inline using the multi-version JAR feature (i.e. placing the class in META-INF/versions/9/module-info.class).

Although Mockito already distributes as an automatic module, the requirements on bytebuddy and the bytebuddy agent do not get resolved automatically, which results in a somewhat cryptic error the first time you try to use mocks.

I believe that the following would resolve this issue:

module org.mockito {
  requires transitive net.bytebuddy;
  requires transitive net.bytebuddy.agent;

  exports org.mockito;
  exports org.mockito.{other packages here};
}

This would reduce the confusion around JPMS for new users, and remove the need to directly depend on implementation detail.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions