The best approach is to use two different profiles for each Application Server in the same Project Object Model deescriptor and the activation of the profiles could be done regarding some properties:
<profiles>
<profile>
<id>pkg-all</id>
<activation>
<property>
<name>targetedAS</name>
</property>
</activation>
<modules>
<module>jboss</module>
<module>weblogic</module>
</modules>
</profile>
<profile>
<id>pkg-jboss</id>
<activation>
<property>
<name>targetedAS</name>
<value>jboss</value>
</property>
</activation>
<modules>
<module>jboss</module>
</modules>
</profile>
<profile>
<id>pkg-weblogic</id>
<activation>
<property>
<name>targetedAS</name>
<value>weblogic</value>
</property>
</activation>
<modules>
<module>weblogic</module>
</modules>
</profile>
If you are not already familiar with Maven profiles you can refer to the official documentation.