Module-Info For Netty

Viewed 65

I'm trying to build a project that depends on io.netty, and it's the one third-party library that doesn't seem to support Java9+ modules since I don't see any module-info.class inside the jars.

When I come to run my project I get the error: Error occurred during initialization of boot layer java.lang.module.FindException: Module io.netty.buffer not found, required by ...

I have seen elsewhere that this can [in theory] be built using jdeps and an alternative third-party Maven plugin, but my question is that I can't believe I'm the first person to ask if module versions of Netty have been built previously, and if so does anyone know if these pre-built module versions already somewhere out there in the ether.

Also, Java9's modules has been out for a while and why aren't the developers behind Netty supporting modules?

1 Answers

The Netty GitHub repo README says this:

Usage with JDK 9+

Netty can be used in modular JDK9+ applications as a collection of automatic modules. The module names follow the reverse-DNS style, and are derived from subproject names rather than root packages due to historical reasons. They are listed below:

io.netty.all
io.netty.buffer
io.netty.codec
io.netty.codec.dns
io.netty.codec.haproxy
io.netty.codec.http
io.netty.codec.http2
io.netty.codec.memcache
io.netty.codec.mqtt
io.netty.codec.redis
io.netty.codec.smtp
io.netty.codec.socks
io.netty.codec.stomp
io.netty.codec.xml
io.netty.common
io.netty.handler
io.netty.handler.proxy
io.netty.resolver
io.netty.resolver.dns
io.netty.transport
io.netty.transport.epoll (native omitted - reserved keyword in Java)
io.netty.transport.kqueue (native omitted - reserved keyword in Java)
io.netty.transport.unix.common (native omitted - reserved keyword in Java)
io.netty.transport.rxtx
io.netty.transport.sctp
io.netty.transport.udt

Automatic modules do not provide any means to declare dependencies, so you need to list each used module separately in your module-info file.
Related