You need to specifically define a jarModule
configuration in the modules
section of your maven-ear-plugin configuration
for the projectA dependency and explicitly set where you want the jar placed.
So your POM would be:
<plugin>
<artifactId>maven-ear-plugin</artifactId>
<configuration>
<defaultLibBundleDir>lib</defaultLibBundleDir>
<earSourceDirectory>${basedir}</earSourceDirectory>
<earSourceIncludes>META-INF/*</earSourceIncludes>
<archive>
<manifest>
<addClasspath>true</addClasspath>
</manifest>
</archive>
<generateApplicationXml>false</generateApplicationXml>
<applicationXML>${basedir}/META-INF/application.xml</applicationXML>
<modules>
<jarModule>
<groupId>com.xxx.sms</groupId>
<artifactId>projectA</artifactId>
<bundleDir>/</bundleDir>
</jarModule>
</modules>
</configuration>
</plugin>
The value (/
) in the bundleDir
tells the maven-ear-plugin to place projectA's jar in the root folder of the ear instead of the default location of lib.
You can see details on this in the plugins documentation here: http://maven.apache.org/plugins/maven-ear-plugin/examples/customizing-module-location.html