Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven sources vs resources

Tags:

java

maven

what is the difference between these two folders? Why my beans have to go in resources, so my web app to work?

src/main/java Application/Library sources
src/main/resources Application/Library resources
like image 927
Pavel Avatar asked Jan 12 '23 05:01

Pavel


1 Answers

The src/main/java contains your java source codes. that is, your java packages, *.java files.

The src/main/resources contains "resources" file of your project. e.g. properties file, configuration files (xml, ini, conf....) they are in classpath of your project.

Usually the compiled sources (*.class files) and those resources would be in target/classes.

Your web app sources (e.g. Jsp/jspx, js, html...) should go to src/main/webapp

like image 80
Kent Avatar answered Jan 22 '23 19:01

Kent