Profiles should be a good fit for this. According to the information at the maven build profile docs this shouldn't work. Specifically, they say
build as specified inside of a profile is not a full implementation of the traditional
build POM element. This build is really another class in the model - from which the POM
build is derived - and only allows the plugins and pluginManagement subelements when
defined here. This sidesteps any issues with secondary validation after the pom.xml is
parsed in this case.
But I just tested it and it included the appropriate resources by including a build element with a resources definition inside.
In your pom, you will want to include a profile for each of your webapps. For instance, in my test, I did the following:
<profile>
<id>abc</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<resources>
<resource>
<directory>abc</directory>
<includes>
<include>**/*</include>
</includes>
</resource>
</resources>
</build>
</profile>
<profile>
<id>xyz</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<resources>
<resource>
<directory>xyz</directory>
<includes>
<include>**/*</include>
</includes>
</resource>
</resources>
</build>
</profile>
Then, I had a a directory abc containing a file abc.properties, and another xyz with a corresponding xyz.properties file.
For all shared resources, you would have a element that also has a element that includes all those that you want to be used in every webapp.
Finally, when you build you would specify the profile of the webapp you would like to build, such as
mvn -P abc clean install
One BIG issue you may have with this approach is that each artifact built will have the same name, and one will overwrite the other in your local repository.