I'm trying to build an ear using the maven-ear-plugin from a war (and a few other resources, but forget that for now). Anyway, I'm trying to generate the application.xml file using the ear plugin.
My pom looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>my-ear-mvn</artifactId>
<name>My Ear</name>
<description>My Ear</description>
<packaging>ear</packaging>
<build>
<plugins>
<plugin>
<artifactId>maven-ear-plugin</artifactId>
<version>2.10.1</version>
<configuration>
<defaultLibBundleDir>APP-INF/lib</defaultLibBundleDir>
<skinnyWars>true</skinnyWars>
<modules>
<webModule>
<groupId>org.my.app</groupId>
<artifactId>my-web-war</artifactId>
<bundleFileName>my-web.war</bundleFileName>
<uri>my-web</uri>
<context-root>MYWeb</context-root>
</webModule>
...
</modules>
</configuration>
</plugin>
</plugins>
</build>
...
And I get an application.xml file that looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE application PUBLIC
"-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"
"http://java.sun.com/dtd/application_1_3.dtd">
<application>
<display-name>my-ear-mvn</display-name>
<description>My Ear</description>
<module>
<web>
<web-uri>my-web</web-uri>
<context-root>MYWeb</context-root>
</web>
</module>
</application>
All well and good so far, the uri child element of the webModule element (from the pom) generates the corresponding web-uri child element of the web element in the application.xml. However, when I look at my ear, there is a file called my-web in the root of the ear where I would expect to see my-web.war. Sure enough, if I rename it to war, I can crack it open and it contains everything I would expect to see in that war.
Anyway, I can fix this? Thanks!