Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

which files under src/main/resources and files under WEB-INF?

I'm using Maven nowadays and I have to "mavenize" a dynamic web project (J2EE/Eclipse). I got the application.war successfully built, but when I deploy it in Tomcat, I got so many errors and I began to resolve them and I know exactly what's the problem: I didn't place the right files Under the right folder!

So my question is: which files do I have to place Under src/main/resources and which files do I keep it Under WEB-INF?

I'll post a picture with all my files Under WEB-INF and hope that will help to answer:

Files Under WEB-INF

like image 833
Hohenheim Avatar asked Oct 25 '25 13:10

Hohenheim


1 Answers

The files that should end up in the classpath (i.e. under WEB-INF/classes in the generated war file) should be in src/main/resources.

The files that should end up under the root of the war file should be in src/main/webapp. So, if you want a file to end up in WEB-INF/foo/bar in the generated war file, the file should be under src/main/webapp/WEB-INF/foo/bar. If you want a file to end up in images in the generated war file, the file should be under src/main/webapp/images

like image 77
JB Nizet Avatar answered Oct 28 '25 03:10

JB Nizet