No dependencies when generating-module-info jdeps

I am trying to run jdeps with the following command:

jdeps --module-path modules --generate-module-info out com.demo.market.jar 

My com.demo.market.jar depends on both application modules and automatic modules. I put all the dependencies in the "modules" folder, but I got an error:

 Error: missing dependencies com.demo.market.platform.MarketPlace -> com.demo.client.wholesale.Client not found com.demo.market.platform.MarketPlace -> com.demo.product.api.Product not found com.demo.market.platform.MarketPlace -> com.demo.product.laptop.Laptop not found com.demo.market.collector.ProductsCollector -> com.demo.logistic.DeliveryService not found com.demo.market.collector.ProductsCollector -> com.demo.product.api.Product not found 

But when I add --add-modules , it works fine.

 jdeps --module-path modules --add-modules com.demo.client,com.demo.product,com.demo.logistic --generate-module-info out com.demo.market.jar 

Am I doing something wrong? I assumed that jdeps will find all the modules instead of manually adding them.

+5
source share
1 answer

When performing the following steps:

 jdeps --module-path modules --generate-module-info out com.demo.market.jar 

The modules that are allowed from the directory are observable modules, which in your case cannot do this with a set of root modules.


On the other side of the question -

 jdeps --module-path modules --add-modules com.demo.client,com.demo.product,com.demo.logistic --generate-module-info . com.demo.market.jar 

On the other hand, by adding them explicitly, make sure that the modules are present in the set of root modules.


Alternatively (from JEP261 # Module System you can try using the command

 jdeps --module-path modules --add-modules=ALL-MODULE-PATH --generate-module-info out com.demo.market.jar 

As a final special case, both at runtime and connection time, if ALL-MODULE-PATH , then all observable modules found in the corresponding modular paths are added to the root set. ALL-MODULE-PATH affects both compilation time and runtime. This is intended for use in assemblies such as Maven, which already ensure that all modules on a module are needed. It is also a convenient tool for adding automatic modules to the root set.


Please note that the commands are executed: -

  • Also, the jdeps output common in the question is true with -verbose:class ideally.
+5
source

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


All Articles