My application is modularized in such a way that multiple EARs or WARs are built through a Maven multi-module project—this corresponds to the idea of a modular monolith. At the end of the build, these EARs should be bundled with the WildFly server into a single image using the WildFly Maven plugin. It seems to me that this isn't possible with the WildFly Maven plugin because only one archive can be specified using `<filename>`.
At the moment, my workaround involves calling Glow and Galleon via CLI. For the sake of completeness, here is an excerpt from the last build step:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.4.1</version>
<configuration>
<skip>false</skip>
</configuration>
<executions>
<execution>
<id>run-glow</id>
<phase>package</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>java</executable>
<arguments>
<argument>-jar</argument>
<argument>${org.wildfly.glow:wildfly-glow:jar}</argument> <argument>scan</argument>
<argument>../ear-1/target/ear-1-${project.version}.ear</argument>
<argument>../ear-2/target/ear-2-${project.version}.ear</argument> <argument>--provision=PROVISIONING_XML</argument>
<argument>--output-dir=${project.build.directory}</argument>
<argument>--suggest</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>run-galleon</id>
<phase>package</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>java</executable>
<arguments>
<argument>--add-modules=
java.se</argument>
<argument>
-Dlogging.configuration=file:${project.basedir}/src/galleon/galleon-cli-logging.properties
</argument>
<argument>-jar</argument>
<argument>${org.jboss.galleon:galleon-cli:jar}</argument> <argument>provision</argument>
<argument>${project.build.directory}/provisioning.xml</argument>
<argument>--dir=${project.build.directory}/server</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>