I am looking for suggestion in putting image file maven web project. One of classes under src/main/java need to use an image file. My problem is, if i put image file under s
The default resource directory for all Maven projects is
src/main/resourceswhich will end up in target/classes and in WEB-INF/classes in the WAR. The directory structure will be preserved in the process.
.
|-- pom.xml
`-- src
`-- main
|-- java
| `-- com
| `-- example
| `-- projects
| `-- SampleAction.java
|-- resources
| `-- images
| `-- sampleimage.jpg
`-- webapp
|-- WEB-INF
| `-- web.xml
|-- index.jsp
`-- jsp
`-- websource.jsp
The suggested way to put your resources is in the src/main/resources
Reference: Adding and Filtering External Web Resources