Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[websocket-dev] module-info

Hi all,

We have a platform requirement to provide module-info.class for our JARs.

We have two JARs

- contains the jakarta.websocket package
- contains the jakarta.websocket.server package
- JPMS module name: jakarta.websocket

- contains the jakarta.websocket package
- JPMS module name: jakarta.websocket.client

The difficulty is the overlapping packages. You aren't meant to do that in JPMS. jakarta.websocket-api.jar also has an unnecessary, optional Maven dependency on jakarta.websocket-client-api.jar

I can think of a couple of options.

1. Remove the jakarta.websocket package from jakarta.websocket-api.jar and add a "proper" dependency on jakarta.websocket-client-api.jar.

As far as I can tell, the only reason this hasn't been done before was to have a single JAR with no dependencies for the 'server' API. I can see the benefit in that at the time, but in an increasingly modular world that creates as many problems, if not more, than it solves.

2. Refactor the build so the jakarta.websocket sources are copied into / used by the jakarta.websocket-api build (for compilation, Javadoc, etc.)

This should produce a result very similar to what we have now.

3. Some other Maven magic (I'm no Maven expert) to solve this. Suggestions welcome.

Thoughts on what we should do, alternative solutions etc. welcome.

I am currently leaning towards option 1 but could be easily persuaded to change my mind.


Back to the top