I have a basic springboot application with the following folder structure. inside webapps i have some images and css.
If i run it using my Intellij IDE, I am able to access images and css
at localhost:8080/images/test.png
But if i create a fat jar and run it using java -jar demo.jar
then i am not able to access these images or css folders
This is how i am building my jar using maven plugin
<build>
<resources>
<resource>
<directory>src/main/webapp</directory>
<includes>
<include>css/default.css</include>
<include>images/*</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>build-info</goal>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
How can i make sure that these images and css files will be available when running as a jar file