We're currently migrating to JPMS setting up module-info.java for all modules in a maven multi-module project.
For us it would be ideal to have module-info.java already reside in "dev" branch but not affecting any builds. So idea is to exclude module-info.java by default and include it only in specific maven profiles.
Does that make sense?
Anyway, doesn't work for me, module-info.java is picked up even though in excludes section as follows:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${version.maven-compiler-plugin}</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
<release>${maven.compiler.release}</release>
<compilerArgs>
<arg>-Xlint:${maven.compiler.warningsToIgnore}</arg>
</compilerArgs>
<excludes>
<exclude>**/module-info.java</exclude>
</excludes>
</configuration>
</plugin>
Any ideas?
PS: Idea was taken from How to exclude module-info.java in Netbeans (11)?