jlink - excluding optional dependencies

Gunnar Morling gunnar at hibernate.org
Fri Feb 17 08:45:17 UTC 2017


Hi,

How can I exclude optional dependencies when creating a runtime image
using jlink?

In more detail, I have a module A which declares an optional
dependency to another module B via "requires static". I'd like to
create a runtime image which only contains A.

When running jlink with "--add-modules A", I'm getting "Error: B not
found". jlink finishes when I run it with "--add-modules A,B" but then
B is part of the image, too, as per the images release file.

Thanks,

--Gunnar


More information about the jigsaw-dev mailing list