views:

283

answers:

3

I have a Web application in maven that follows this structure:

src
`-- main
    |-- java
    |-- resources
    `-- webapp

Is is better to put it in the main folder and then the maven plug in will try to move it or I should put it inside the webapp folder and why?

+4  A: 

If you don't need to filter CSS and JS files, I would simply put them in src/main/webapp (if you put them in src/main/resources, they will end up in target/classes and in WEB-INF/classes in the WAR which is very unlikely what you want). If you need to filter them, additional resources can be included in the WAR using the webResources parameter. Have a look at Adding and Filtering External Web Resources for more details.

Pascal Thivent
Thanks, that explained why I see both flavors when goggling the location
MexicanHacker
+2  A: 

I think they should be under src\main\webapp. The main rationale for saying this is that this is the standard suggested by Maven, and the Maven philosophy is that all projects should follow the same structure as much as possible.

lrussell
A: 

My web page is unable to load the css which i placed under webapp/styles/tabs.css and referenced it in my jsp as

Please suggest

Vijay