1

The concept guide of Project Jigsaw introduces "a bridge between two automatic modules exporting the same package". 1

In fact, currently both of two automatic modules grpc.api and grpc.context export io.grpc package, as is reported in its github. 2

The bridge seems to be the exact solution to apply Jigsaw for a project with these libraries, but the documentation does not offer any concrete way to achieve it.

Is there any javac command option for this purpose? Or, is there any recommended way to overcome this situation?

Thanks!

Yuki Hashimoto
  • 1,013
  • 7
  • 19
  • Not sure how you would be running the application, but you could, for example, choose to place `grpc.api.jar` on classpath while the `grpc.context.jar` on modulepath. But remember, the `grpc.api` would not be accessible as an automatic module anymore if you do so. For `javac` command options look for `--class-path` and `--module-path` under [this document.](https://docs.oracle.com/en/java/javase/13/docs/specs/man/javac.html) – Naman Jan 31 '20 at 10:26

1 Answers1

1

…the documentation does not offer any concrete way to achieve it…

In this project and in this one I have implemented a concrete application of what Reinhold prescribes in that „Bridges to the class path“ documentation you linked to in your question.

…is there any recommended way to overcome this situation?…

In addition to those two bridge-based approaches, I've also been able to solve both the Springfox and the gRPC issues using the --patch-module command line option.

But even though --patch-module is a more straightforward way to overcome the split package situation, it's „strongly discouraged“…

The --patch-module option is intended only for testing and debugging. Its use in production settings is strongly discouraged.“

deduper
  • 1,944
  • 9
  • 22