-3

I am having client requirement that maven project which generate a war which in turn contains submodules as the jar?

let me clarify the question

This is my master pom.xml inside that i am having two modules named child1 and child2.

I need a MasterWebApp.war inside which the child1.jar and child2.jar presents.

If i changing the packaging as war to packaging - pom then error disappeared but i cant get the required war while maven clean install

<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.abc</groupId>
<artifactId>MasterWebApp</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>Master Maven Webapp</name>
<url>http://maven.apache.org</url>
<properties>
    <org.springframework.version>4.1.7.RELEASE</org.springframework.version>
</properties>
<modules>
    <module>child1</module>
    <module>child2</module>
</modules>

.......
MPPNBD
  • 1,566
  • 4
  • 20
  • 36

2 Answers2

0

you can execute two ways.

1) in eclipse. Right click on project , click on run as --> maven build , give goals as "clean install" will generate war in target folder of your project

2) using command prompt, navigate to directory where pom.xml present and execute below commands

mvn clean install package

it will generate war in target folder

Raghav N
  • 201
  • 1
  • 6
  • Thanks Raghav, i added more text to my question, i think now you can able understand the question – MPPNBD Jul 14 '15 at 15:04
  • please go through the below link for details, http://stackoverflow.com/questions/14467325/maven-combining-multiple-module-jars-into-one-war-file – Raghav N Jul 14 '15 at 16:17
0

Thanks Raghav, i searched for any alternative way to achieve this, but no more available, so i used the way which u gave the link.

Thanks for the help.

MPPNBD
  • 1,566
  • 4
  • 20
  • 36