Hi got the solution >> here it is.. this is a pom.xml of ear project
<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>
<groupId>Test</groupId>
<artifactId>Test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>ear</packaging>
<dependencies>
<!--Dependency for jar-->
<dependency>
<groupId>com.jar</groupId>
<artifactId>com.jar</artifactId>
<version>1.0</version>
<type>war</type>
</dependency>
<!--Dependency for war1-->
<dependency>
<groupId>com.war2</groupId>
<artifactId>com.war2</artifactId>
<version>0.0.1-SNAPSHOT</version>
<type>war</type>
</dependency>
<!--Dependency for war2-->
<dependency>
<groupId>com.war1</groupId>
<artifactId>com.war1</artifactId>
<version>0.0.1-SNAPSHOT</version>
<type>war</type>
</dependency>
</dependencies>
<build>
<finalName>Project</finalName>
<plugins>
<plugin>
<artifactId>maven-ear-plugin</artifactId>
<version>2.8</version>
<configuration>
<finalName>MyEarFile</finalName>
<version>5</version>
<modules>
<!--Webmodule for war1-->
<webModule>
<groupId>com.war1</groupId>
<artifactId>com.war1</artifactId>
<uri>war1.war</uri>
<bundleFileName>war1.war</bundleFileName>
</webModule>
<!--Webmodule for war2-->
<webModule>
<groupId>com.war2</groupId>
<artifactId>com.war2</artifactId>
<uri>war2.war</uri>
<bundleFileName>war2.war</bundleFileName>
</webModule>
</modules>
</configuration>
</plugin>
</plugins>
</build>
</project>
Note:: groupId and artifactId metioned here must match with groupId and artifactId mentioned in the project's pom.xml.
Also dependency of jar must be present in this i.e. ear's pom.xml and not in both app's pom.xml.
At time of maven install it automatically refers to jar's contents..