How to export all packages from Java 9 module?

Right now, for every module that I have, I need to explicitly specify the packages that I want to export. For instance:

module core {
    exports cc.blynk.server.core;
    exports cc.blynk.server.core.protocol.handlers.decoders;
    exports cc.blynk.server.core.protocol.handlers.encoders;
}

However, this is not very convenient. I would like to do something like this:

module core {
    exports cc.blynk.server.core.*;
}

Is there any way to do this? Where does this restriction come from?

+4
source share
1 answer

Using

module core {
    exports cc.blynk.server.core.*;
}

discouraged, as this can lead to conflicts in different packages exported from different modules, which does not meet the goals of code modulation.


Also, quoting one of the threads:

, , API, . . , . , , , com.abs.* , com.abs.foo .

+8

Source: https://habr.com/ru/post/1686681/


All Articles