Open xenoterracide opened 5 days ago
At least the dependency consistency check would really be helpful, so that
implementation
=> requires
api
=> requires transitive
compileOnly
=> requires static
compileOnlyApi
=> requires static transitive
Not sure about runtimeOnly
, but they might need to be absent in module-info
.
AFAIK runtime only dependencies should be excluded from module-info
.
There's one exception to things being added to module-info
that I've found though. java
jdk
namespaced modules may need to be listed in a module-info
even if no direct abi dependency exists. This is because automatic modules can access everything and do not define which modules they require (static or otherwise). I've run into spring boot issues where I needed to add java.sql
to my dependencies. I also ran into a spring boot triggered issue where it tried to load mockito even though I wasn't using it at all, just because it was on the classpath, and that triggered a mockito bug where it requires jdk.agent
. So essentially any false positives on java
/jdk
should be ignored.
Is your feature request related to a problem? Please describe.
java module (module-info) should agree with the gradle dependencies, for example
compileOnlyApi
should generally matchrequires static transitive
I suspect this is a bidirectional thing though. For example if I have
exports com.myorg.foo
but do not haveexports com.myorg.foo.internal
then even if something that would normally be detected asapi
should not be api.if possible,
opens... to
specifications should possibly be determined, I suspect this would require looking at tests though.I hope this is clearer than mud.
cc: @jjohannes you might be interested in this issue, or have ideas/suggestions