Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for multi-release JARs #3

Open
zyxist opened this issue Oct 11, 2017 · 1 comment
Open

Support for multi-release JARs #3

zyxist opened this issue Oct 11, 2017 · 1 comment

Comments

@zyxist
Copy link
Owner

zyxist commented Oct 11, 2017

Multi-release JARs allow packaging multiple variants of individual classes that target different JDK versions. Currently, no build system supports them, and there is no agreed convention on a directory structure layout.

A closer look at similar Maven plugins shows that they favor the following layout:

  • /src/main/java - base JDK,
  • /src/main/java9 - only the classes with JDK9-specific implementation,
  • /src/main/java10 - only the classes with JDK10-specific implementation,
  • etc.

The support would have to look like this:

  • running the compilation several times:
    • once for the base JDK,
    • then, once for each supported Java version.
  • each compiler run would have to take the combined effect of all the previous compilations, and compile only the classes that have their own variants in the given JDK version,
  • hooking into jar plugin to pack everything correctly,
  • adding the necessary entry to the manifest,

The open question is: what to do with unit tests?

@sormuras
Copy link

Hi Tomasz, who needs unit tests?!

As mr-jars are only fully supported when they are packaged (i.e. not exploded in directory tree structure) one must execute test after packaging mr-jars.

Here is an example how to organize black box unit tests after the package phase is done: https://github.com/sormuras/testing-in-the-modular-world
Note that the module foo may have /src/main/java<version> folders.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants