My application uses some additional files which I have inside the resource folder. When I do the regular build with Maven and package my app into JAR, I can see all my resources in case I unzip this archive.
But when I create a docker image I use spring-boot-maven-plugin to make my JAR archive executable. For some reason my resources aren't being added to the new repacked JAR. Moreover I can not even unzip it because it is corrupted.
Here is the way I set the repackage goal in my pom.xml:
<id>prod</id>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>1.5.3.RELEASE</version>
<configuration>
<mainClass>ApplicationName</mainClass>
<executable>true</executable>
<arguments>
<argument>--spring.profiles.active=prod</argument>
</arguments>
<!--<addResources>true</addResources>-->
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
<configuration>
<!--<includeSystemScope>true</includeSystemScope>-->
<!--<layout>JAR</layout>-->
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
I want to add that when I run my image in docker it works fine but all the needed resources are missing.
Has anyone run into the same problem? Or maybe you can suggest how to fix it.