If you use Maven then you can exclude some classes / packages from being included in the resulting WAR and you can also have multiple targets and exclude different subsets of the code in that way.
This method assumes that you either keep the functionality separated into multiple "struts.xml" action definition files OR a if you use Struts2 conventions plugin with annotations etc then you end up with a very nice solution.
So, in pom.xml you have to first exclude all modules:
<build>
<finalName>badNameUseBuildProfileInstead</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
<excludes>
<exclude>**/struts-module1.xml</exclude>
<exclude>**/struts-module2.xml</exclude>
<exclude>**/struts-module3.xml</exclude>
</excludes>
</resource>
</resources>
...
And then you make a build profile that includes the required modules:
...
<profiles>
<profile>
<id>web</id>
<build>
<finalName>${project.artifactId}</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/struts-web.xml</include>
</includes>
</resource>
</resources>
...