1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[JBoss] Excluding a webmodule from an ear

Discussão em 'StackOverflow' iniciado por Stack, Novembro 21, 2025.

  1. Stack

    Stack Membro Participativo

    I have the following configuration inside my ear module:

    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-ear-plugin</artifactId>
    <configuration>
    <version>7</version>
    <defaultLibBundleDir>lib</defaultLibBundleDir>
    <outputDirectory>${project.build.directory}</outputDirectory>
    <generateApplicationXml>false</generateApplicationXml>
    <skinnyWars>true</skinnyWars>
    <modules>
    {other modules configurations}
    <webModule>
    <groupId>example.groupId</groupId>
    <artifactId>test-support</artifactId>
    <contextRoot>${contextRoot}</contextRoot>
    <moduleId>test-support</moduleId>
    <unpack>false</unpack>
    <bundleFileName>test-support-${app.jndi.context}.war</bundleFileName>
    <excluded>${exclude.test.war}</excluded>
    </webModule>
    </modules>
    <filtering>true</filtering>
    <archive>
    <manifestEntries>
    <Logging-Profile>${log-profile-name}</Logging-Profile>
    </manifestEntries>
    <manifest>
    <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
    <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
    </manifest>
    </archive>
    </configuration>
    </plugin>


    I need this webmodule to be excluded whenever the property exclude.test.war is true, since it's a module used only for tests and shouldn't go to production. It seems like the file gets excluded correctly from the build (I can't see it in the target directory), but I can't deploy, because it's still listed in the application.xml and in the jboss-deployment-structure.xml. How can I configure these 2 to ignore the war, when it's excluded from the ear build?

    Continue reading...

Compartilhe esta Página