Maven plugin that post-processes modular applications' module-info.class
files after compilation to add all the required provides
clauses for all services registered under META-INF/services
as well as adding requires
for certain avaje-inject plugins if applicable.
<plugin>
<groupId>io.avaje</groupId>
<artifactId>avaje-provides-maven-plugin</artifactId>
<version>${version}</version>
<extensions>true</extensions>
</plugin>
Given a module-info like:
module avaje.example {
requires io.avaje.inject;
requires static io.avaje.spi;
}
And a META-INF/services/my.example.SPIServiceInterface
file (either manually created or generated by APT):
my.example.SPIServiceInterfaceImpl
This goal will transform the module-info classfile after compilation to roughly look like:
module avaje.example {
requires io.avaje.inject;
requires static io.avaje.spi;
provides my.example.SPIServiceInterface with my.example.SPIServiceInterfaceImpl;
}
As the add-module-spi
goal runs after compilation, this goal generates a file before compilation that signals any apt project that uses avaje-prisms's ModuleInfoReader
for service validation to disable provides
module validation.