maven ear plugin not picking up application.xml
Asked Answered
D

2

5

I am using jbosscc-seam-archtype 1.2 and I am putting the application.xml in EAR project, under /src/main/application/META-INF/ but the maven-ear-plugin is not picking it up. any suggestion?

Here is the snippet of my maven EAR plugin:

<plugins>
    <plugin>
            <artifactId>maven-ear-plugin</artifactId>
            <configuration>
                <version>5</version>    
                <modules>
                    <webModule>
                        <groupId>com.***</groupId>
                        <artifactId>***-war</artifactId>
                        <contextRoot>***</contextRoot>
                        <unpack>${exploded.war.file}</unpack>
                    </webModule>

                    <jarModule>
                        <groupId>com.***</groupId>
                        <artifactId>***-datamodel</artifactId>
                        <includeInApplicationXml>true</includeInApplicationXml>
                    </jarModule>

                    <ejbModule>
                        <groupId>com.***</groupId>
                        <artifactId>***-bootstrap</artifactId>
                        <excluded>${exclude.bootstrap}</excluded>
                    </ejbModule>

                    <ejbModule>
                        <groupId>org.jboss.seam</groupId>
                        <artifactId>jboss-seam</artifactId>
                    </ejbModule>

                    <jarModule>
                        <groupId>org.jboss.el</groupId>
                        <artifactId>jboss-el</artifactId>
                        <bundleDir>lib</bundleDir>
                    </jarModule>

                </modules>

                <jboss>
                    <version>${version.jboss.app}</version>
                    <loader-repository>***:app=ejb3</loader-repository>
                </jboss>
            </configuration>
        </plugin>

What am I doing wrong?

Dominique answered 7/10, 2011 at 14:33 Comment(0)
U
8

By default, your application.xml will not be picked even if you include it in src/main/application/META-INF/application.xml in your maven ear project that's because it will be autogenerated by the configuration specified at <configuration> of the maven-ear-plugin. If you want yours to be included you need to change generateApplicationXml to false (defaults to true).

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-ear-plugin</artifactId>
    <version>2.4.2</version>
    <configuration>
        <version>6</version>
        <displayName>MyEAR</displayName>
        <defaultLibBundleDir>lib</defaultLibBundleDir>
        <modules>
            <webModule>
                <groupId>com.test</groupId>
                <artifactId>my-web</artifactId>
                <bundleFileName>my-web.war</bundleFileName>
                <contextRoot>/MyWeb</contextRoot>
            </webModule>
        </modules>
        <generateApplicationXml>false</generateApplicationXml>            
    </configuration>
  </plugin>
Urbanist answered 18/4, 2016 at 16:7 Comment(0)
K
6

You can use <applicationXml>/your/location/</applicationXml> in <configuration> element to specify location of your custom application.xml file.

Please check if you really need custom application.xml file, otherwise use <generateApplicationXml>true</generateApplicationXml>.

Knurly answered 25/6, 2013 at 12:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.