Making jdeps aware of exported API

Gunnar Morling gunnar at hibernate.org
Thu Mar 23 09:24:38 UTC 2017


Hi,

I would like to suggest to add an option to jdeps for describing the
intended exported API of descriptors created by
--generate-module-info. This would have two benefits:

* Limiting the number of exported packages in the generated descriptor
to the intended public API
* Adding the "transitive" modifiers only to those "requires"
statements whose types are used in the exported API

While it's relatively simple to rework descriptors after generation
and remove any unwanted exports, that's not the case for removing
superfluous "transitive" modifiers. Identifying them would require to
parse the input JAR once more to find out whether a given dependence
is used in public/protected signatures of the exported API or not.

If the intended exported API could be passed to jdeps - e.g. in form
of regular expressions or some other kind of exclude/include patterns
- no further post-processing would be needed for generating
descriptors with a well-defined API.

I had a look at the --api-only option, but this seems only to be about
public/protected access and not the exported packages of a module.

Thanks for your consideration,

--Gunnar


More information about the jigsaw-dev mailing list