You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
New rules: enforce Java Module System descriptor policy #995
Projects adopting module-info.java want to keep their descriptors clean, but there is no built-in way to enforce module policy in the build — today it is review-by-eyeball or ad-hoc scripts.
Proposed rules
requireExplicitModules — fail if the project artifact and/or its production dependencies are automatic modules (Automatic-Module-Name) or unnamed (no module-info). Optional allowlist.
banUnjustifiedOpens — fail on opens directives in the project's module-info that are not in a configured allowlist (default: none allowed).
requireMinimalExports — fail on exported packages matching a configurable pattern (default **.internal.**, **.impl.**), i.e. exporting non-API packages.
Implementation notes
Reads module-info.class directly from the class-file bytes (JVMS §4.7.25) via a small dependency-free reader, so it works on the plugin's Java baseline without ASM or the java.lang.module API. A working prototype (reader + unit tests) already exists from the extra-enforcer-rules exploration and can be moved here.
Rules target the reactor module's own compiled module-info.class (post-compile phase) plus dependency jars for the automatic/unnamed check.
Full unit tests + integration tests + site documentation, following the existing rule style.
Activity
feat: add module-info reader for enforcer rules
feat: add three Java module-info enforcer rules
test: add ITs for module-info enforcer rules
docs: document module-info enforcer rules
Address review: visibility, immutability, docs
Fail fast on Java 8; address elharo review nits
Require Java 9+ to run the module rules
Gate the Java 9+ guard on module-info presence