如何在 Project Jigsaw 中合并导出相同包的两个自动模块? [英] How to merge two automatic modules exporting the same package in Project Jigsaw?

查看:32
本文介绍了如何在 Project Jigsaw 中合并导出相同包的两个自动模块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Project Jigsaw 的概念指南介绍了导出相同包的两个自动模块之间的桥梁".1

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

事实上,目前两个自动模块grpc.apigrpc.context都导出io.grpc包,如它的github.2

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

似乎是将 Jigsaw 应用于具有这些库的项目的确切解决方案,但文档没有提供任何具体的方法来实现它.

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.

是否有任何用于此目的的 javac 命令选项?或者,是否有任何推荐的方法来克服这种情况?

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

谢谢!

推荐答案

……文档没有提供任何具体的实现方法……

在这个项目中在这个我已经实现了 Reinhold 规定的具体应用„连接到类路径您在问题中链接的文档.

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.

……有什么推荐的方法可以克服这种情况吗?……

除了这两种基于桥接的方法之外,我还能够使用 --patch-module 命令解决 Springfox 和 gRPC 问题线选项.

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.

但是即使 --patch-module 是克服拆分包情况的更直接的方法,它仍然是„强烈不鼓励……

--patch-module 选项仅用于测试和调试.强烈建议不要在生产环境中使用它.

这篇关于如何在 Project Jigsaw 中合并导出相同包的两个自动模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆