File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 5812

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:

JBoss In Action
Don't get me started about those stupid light bulbs.
Similar Threads
java.util.MissingResourceException: Can't find bundle for base name in JSF Spring Maven project
Needs to Import Other JAR Files to My Spring Web Services Project
Error on making a project with m2e + eclipse indigo + springmvc-archetype
Migrating a project from Ant to Struts
compile servlet with Maven 2