GeeCON Prague 2014*
The moose likes Ant, Maven and Other Build Tools and the fly likes maven2 expert : explode war which is in a ear and then bundle war then bundle ear Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "maven2 expert : explode war which is in a ear and then bundle war then bundle ear" Watch "maven2 expert : explode war which is in a ear and then bundle war then bundle ear" New topic
Author

maven2 expert : explode war which is in a ear and then bundle war then bundle ear

partha sarathi samantaray
Greenhorn

Joined: Oct 16, 2008
Posts: 7
Hi Maven Experts ,
i have to do following tasks .
1. Create application specific jar, say application1-1.0.jar and application2-1.0.jar. ��� [ Done ]

2. Explode e-billing.ear ��� [How to do]

3. Explode e-billing ���SNAPSHOT.war [How to do]

4. Copy web application specific jars (application1-1.0.jar and application2-1.0.jar) in WEB-INF/lib of the exploded e-billing ���SNAPSHOT.war ��� [ Done ]

5. Copy the application specific static contents to application1 folder in exploded war. Similarly, for web application2. [how to do]
6. Then repackage war [how to do ]
7. Repackage ear. [how to do]


Guys , could you help me to solve above problem.

my pom.xml is as below: which is incomplete:
<modelVersion>4.0.0</modelVersion>
<groupId>com.bt.eBill</groupId>
<artifactId>ebilling-weblogic</artifactId>
<version>1.0</version>
<packaging>ear</packaging>
<name>eBilling application</name>
<url>www.oracle.com</url>
<dependencies>

<!-- <dependency>
<groupId>axis</groupId>
<artifactId>axis</artifactId>
<version>1.4</version>
<scope>provided</scope>
</dependency> -->
<dependency>
<groupId>com.bt</groupId>
<artifactId>application1</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
<!-- <dependency>
<groupId>com.bt</groupId>
<artifactId>application2</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency> -->
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<!-- <version>2.3.1</version> -->
<configuration>
<displayName>eBilling App</displayName>
<description>(C)Copyright 1999-2007 Oracle(R), </description>
<!-- <version>2.0</version> -->
<earSourceDirectory>${project.build.directory}/dependency</earSourceDirectory> <!-- <applicationXml>${project.build.directory}/dependency/META-INF/application.xml
</applicationXml> -->
<!-- <generateApplicationXml>false</generateApplicationXml> -->
<modules>

<!-- <jarModule>
<groupId>axis</groupId>
<artifactId>axis</artifactId>
<bundleDir>lib</bundleDir>
</jarModule> -->
<!-- List Of Jar which is included inside the xma Dir -->

<jarModule>
<groupId>com.bt</groupId>
<artifactId>application1</artifactId>
<bundleDir>WEB-INF/lib</bundleDir>
</jarModule>
<!-- <jarModule>
<groupId>com.bt</groupId>
<artifactId>application2</artifactId>
<bundleDir>WEB-INF/lib</bundleDir>
</jarModule> -->
</modules>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>dependency-maven-plugin</artifactId>
<executions>
<execution>
<id>unpack-eBilling-App</id>
<phase>process-resources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.bt.eBill</groupId>
<artifactId>ebilling-weblogic</artifactId>
<version>1.0</version>
<type>ear</type>
</artifactItem>
</artifactItems>
<outputDirectory>classes</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Hi there,

Have you taken a look at the assembly plugin that Maven provides? Using the assembly plugin in combination with the war and ear plugins will get you where you need.

*Hint* The various plugins allow you to pull in files from various locations in order to build your final EAR file.

Let us know where you get stuck!


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
 
GeeCON Prague 2014
 
subject: maven2 expert : explode war which is in a ear and then bundle war then bundle ear