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

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

问题描述

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

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

事实上,如其github中所述,目前两个自动模块grpc.apigrpc.context都导出了io.grpc包. 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

bridge 似乎是将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?

谢谢!

推荐答案

...文档没有提供实现它的任何具体方法... "

在此项目中 通往类路径的桥 您在问题中链接到的文档.

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天全站免登陆