maven ear plugin not picking up application.xml
Solution 1
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>
Solution 2
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>
.
![Ikthiander](https://i.stack.imgur.com/YR5mf.jpg?s=256&g=1)
Ikthiander
Working on Seam 2, JSF, Jboss these days, ex Spring 3 programmer.
Updated on June 16, 2022Comments
-
Ikthiander about 2 years
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 themaven-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?