Maven does not include the jar dependency resources when building the war archive. The maven-remote-resources
plugin is a way to achieve it. I was let to it by this SO question on copying resources
Just copy almost literally the example page of the plugin documentation. Resources I wanted to include in WEBAPP are located under src/main/resources/rulesproperties directory
. In CORE pom.xml plugins section add :
<plugin>
<artifactId>maven-remote-resources-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<goals>
<goal>bundle</goal>
</goals>
</execution>
</executions>
<configuration>
<includes>
<include>**/rulesproperties/*</include>
</includes>
</configuration>
</plugin>
And in WEBAPP pom.xml plugin section, add
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-remote-resources-plugin</artifactId>
<version>1.5</version>
<configuration>
<resourceBundles>
<resourceBundle>mvnGroupId:CORE:${project.version}</resourceBundle>
</resourceBundles>
</configuration>
<executions>
<execution>
<goals>
<goal>process</goal>
</goals>
</execution>
</executions>
</plugin>
After a mvn clean install
for the webapp project, the rulesproperties
directory and its content is placed under the WEB-INF/CLASSES
directory and correctly accessible as any other classpath resources.