Suppose module m1 requires m2. Now try the following commands:
$ jlink --output myimage --module-path mods --add-modules m1 --exclude-resources /m1/module-info.class
$ jlink --output myimage --module-path mods --add-modules m1 --exclude-resources glob:/m1/**
$ jlink --output myimage --module-path mods --add-modules m1 --exclude-resources /m2/module-info.class
Error: m2 not found
$ jlink --output myimage --module-path mods --add-modules m1 --exclude-resources glob:/m2/**
Error: m2 not found
We need to re-examine the exclude-resources plugin as it was never intended to be able to change the module graph and drop modules list this. More generally, the exclude-resoures plugin makes it too easy to create a DOA image. If the plugin stays it should at least disallow excluding module-info.class.
$ jlink --output myimage --module-path mods --add-modules m1 --exclude-resources /m1/module-info.class
$ jlink --output myimage --module-path mods --add-modules m1 --exclude-resources glob:/m1/**
$ jlink --output myimage --module-path mods --add-modules m1 --exclude-resources /m2/module-info.class
Error: m2 not found
$ jlink --output myimage --module-path mods --add-modules m1 --exclude-resources glob:/m2/**
Error: m2 not found
We need to re-examine the exclude-resources plugin as it was never intended to be able to change the module graph and drop modules list this. More generally, the exclude-resoures plugin makes it too easy to create a DOA image. If the plugin stays it should at least disallow excluding module-info.class.