Reputation: 31
Hi i am just new to maven. My requirement is to build a ear with 2 wars and also create a jar. I tried using some archetypes but few folder structure are missing. My maven folder structure should contain src/main/ java resource webapp test/java test/resource. Which archetype will be a suitable?
Upvotes: 3
Views: 1434
Reputation: 727
You cannot have it in single project, Since the EAR consists of different modules.
So create separate project for war, jar and build.
To create war file use maven-archetype-webapp, and for jar use maven-archetype-quickstart.
Then include those project module in main project pom file with module
Eg
<modules>
<module>expLogdao</module>
<module>expLogservice</module>
<module>expLogweb</module>
<module>expLogear</module>
</modules>
Then use separate project to build ear
Now include all project modules in ear project dependencies tag
<dependency>
<groupId>com.expLog.service</groupId>
<artifactId>expLogservice</artifactId>
<type>jar</type>
<version>0.0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.expLog.dao</groupId>
<artifactId>expLogdao</artifactId>
<type>jar</type>
<version>0.0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.expLog.web</groupId>
<artifactId>expLogweb</artifactId>
<type>war</type>
<version>0.0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
Upvotes: 2
Reputation: 5032
Because of the formatting of the question it is a little tough to see what exactly you want.
Have you looked at org.apache.maven.archetypes.maven-archetype-webapp?
Upvotes: 0