If you use that, you will start to configure complicated configuration build path, war destination target, test source location and packaging issues so on. I strongly recommend you to use maven archetype that follows maven directory convention.
It's appeared that "maven-archetype-webapp" archetype is little outdated to use for latest project.
The best way so far is, use codehaus webapp archetype.
For JDK5 based project
mvn archetype:generate -DgroupId=<your group> -DartifactId=<your artifact> -DarchetypeArtifactId=webapp-jee5 -DarchetypeVersion=1.3 -DarchetypeGroupId=org.codehaus.mojo.archetypes
For JDK6 based project
mvn archetype:generate -DgroupId=<your group> -DartifactId=<your artifact> -DarchetypeArtifactId=webapp-javaee6 -DarchetypeGroupId=org.codehaus.mojo.archetypes
I tried to generate without "-DarchetypeGroupId=org.codehaus.mojo.archetypes" option. then it will show error message.
"The desired archetype does not exist (org.apache.maven.archetypes:webapp-jee5-1.3:1.0)". the reason is the "org.codehaus.mojo.archetypes" archetype group is not maven default archetype group id. For more detail, please refer below link
http://docs.codehaus.org/display/MAVENUSER/Archetypes+List
After that, simply import this project into eclipse
thanks, I've been struggling with the webapp archetype.
ReplyDeleteAlan