You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Shelley L <ra...@gmail.com> on 2007/01/12 21:42:23 UTC

Webapp Standard Directory Layout

The sample usage example of the maven-war-plugin [1] demonstrates a war's
project structure with images in the src/main/resources directory, and a
resulting package structure with the images in web-inf/classes.  According
to the Servlet 2.4 specification [2]:

"The WEB-INF node is not part of the public document tree of the
application. No file contained in the WEB-INF directory may be served
directly to a client by the container."

Since these images are web resources to be deployed to a server, it seems
that these types of resources belong in the src/main/webapp directory. The
resources in src/main/resources might be used for configuration files and
properties used by the classes within the src/main/java directory, but not
likely for images.

Should this usage documentation be updated to a more relevant example, or is
my assumption about the best practice for standard directory layouts for
webapps incorrect?

[1] http://maven.apache.org/plugins/maven-war-plugin/usage.html
[2] http://java.sun.com/products/servlet/download.html#specs

Re: Webapp Standard Directory Layout

Posted by Wayne Fay <wa...@gmail.com>.
I put my images and javascript files etc directly into webapp. And
files which I use internally in my code go into src/main/resources. So
my personal usage seems to reflect that in the Spec.

Sounds like the documentation of m-war-p should probably be updated.

Wayne

On 1/12/07, Shelley L <ra...@gmail.com> wrote:
> The sample usage example of the maven-war-plugin [1] demonstrates a war's
> project structure with images in the src/main/resources directory, and a
> resulting package structure with the images in web-inf/classes.  According
> to the Servlet 2.4 specification [2]:
>
> "The WEB-INF node is not part of the public document tree of the
> application. No file contained in the WEB-INF directory may be served
> directly to a client by the container."
>
> Since these images are web resources to be deployed to a server, it seems
> that these types of resources belong in the src/main/webapp directory. The
> resources in src/main/resources might be used for configuration files and
> properties used by the classes within the src/main/java directory, but not
> likely for images.
>
> Should this usage documentation be updated to a more relevant example, or is
> my assumption about the best practice for standard directory layouts for
> webapps incorrect?
>
> [1] http://maven.apache.org/plugins/maven-war-plugin/usage.html
> [2] http://java.sun.com/products/servlet/download.html#specs
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org