Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jakartaee-platform-dev] module-info tests

Ok, thanks, ModuleDescriptor.read could be useful.

As long as the api jar in your implementation passes the signature tests, internal dependencies should not matter. 

On Oct 6, 2021 at 3:29:49 PM, Thiago Henrique Hupner <thihup@xxxxxxxxx> wrote:
Hi.

It is possible to read a module using the ModuleDescriptor::read (https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/module/ModuleDescriptor.html#read(java.io.InputStream)). Maybe that is useful.

One thing that might be tricky to answer is:
Can API modules depend on other libraries?

I have a use case: My library JoEL is a _expression_ Language implementation. Currently, I'm using the JDK.Dynalink module in the API, as an implementation detail, as most of the API requires to provide an implementation of it in the same class (like jakarta.el.BeanELResolver). However, if a user wants to use it, their JDK has to contain the JDK.Dynalink module.

In this case, it is a module that comes with the Standard JDK, but it is not an official module, but I guess the same rules would apply for 3rd party dependencies.

What do you think?



Back to the top