Eric Ilavia
Eric Ilavia

Reputation: 91

Building .ear and .war with maven

I am generating a maven archetype using the following command "mvn archetype:generate -DgroupId=com.mycompany.core -DartifactId=myproject-core -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false", which generates the war file, now I want to build it using ear file.

I have gone through the web and some posts here that two different archetypes need to created for ear and war files. But I am not getting the starting point here.

Do I need the same archetype command which I am using to generate the structure or do I need to change the parameters? Any help would be greatly appreciated.

THANK YOU

Upvotes: 0

Views: 976

Answers (1)

khmarbaise
khmarbaise

Reputation: 97437

I would suggest to use the correct archetypeArtifactId=maven-archetype-j2ee-simple instead of webapp cause EAR means Java EE application which usually contains at least two modules like:

 +-- root(pom.xml)
       +-- module-war (pom.xml)
       +-- module-ear (pom.xml)

Upvotes: 1

Related Questions