jQuery in Action, 3rd edition
The moose likes Ant, Maven and Other Build Tools and the fly likes MAVEN-ARCHETYPE-WEBAPP 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


Marcos Urata

Joined: Dec 31, 2004
Posts: 26
I am using "Maven 2.1.0 (r755702; 2009-03-18 16:10:27-0300)" version on my project.

I was trying to start a web app using Maven directory structure, so I ran the following command:

However, I was expecting the following directory strutucture to be generated:

But, what Maven generated was:

Is this the default directory structure?? Or I am missing something here ? Why would they suppress the java and test folders?
Peter Johnson

Joined: May 14, 2008
Posts: 5852

Yes, that is the expected structure. Essentially, building a web app takes two projects - a simple java project containing servlets that will be placed into a JAR file, and a webapp project that depends on the JAR file from the simple java project. Or you can do what I did - combine the simple java project and webapp project structures, in which case the servlet classes end up in WEB-APP/classes.

There might be an archetype that already builds such an app structure. Codehaus maintains a list of archetypes: http://docs.codehaus.org/display/MAVENUSER/Archetypes+List

JBoss In Action
I agree. Here's the link: http://aspose.com/file-tools
jQuery in Action, 3rd edition