The project is a Spring MVC with Maven.
Here is the sample folder structure :
- src/main/java
- src/main/resources
- css
- fonts
- images
- js
- messages_en.properties
- src/main/webapp
- WEB-INF
- views
- application-context.xml
- web.xml
- WEB-INF
And here is the build part of effective pom
<sourceDirectory>${basedir}\src\main\java</sourceDirectory>
<scriptSourceDirectory>${basedir}\src\main\scripts</scriptSourceDirectory>
<outputDirectory>${basedir}\target\classes</outputDirectory>
<resources>
<resource>
<directory>${basedir}\src\main\resources</directory>
</resource>
</resources>
<directory>${basedir}\target</directory>
<finalName>m2mproject</finalName>
And the target directory comes out like this
- WEB-INF
- classes
- com....
- images
- fonts
- js
- css
- messages_en.properties
- lib
- views
- apllication-context.xml
- web.xml
- classes
Why maven puts all resources under the classes folder? Is my folder structure wrong ?
WEB-INF/classes
. These are different to remote resources - which should live inwebapp
outside ofWEB-INF
. Maven is doing exactly what it should. – Boris the Spider