Example
Is it possible to somehow configure the spring boot maven plugin to include resources from a dependency.
E.g. if in my spring boot project I have:
<dependency>
<groupId>co.company</groupId>
<artifactId>example</artifactId>
</dependency>
and in that JAR file there is a properties file such as example.properties
jar -tf example.jar | grep example.properties | wc -l
results in 1.
However, when I build the spring boot JAR, this properties file is not added to the src/main/resources
. The JAR containing it is included in BOOT-INF/lib/example.jar
However, in my case. I'd like to extract the content of src/main/resources
out into the boot BOOT-INF/classes/
directory of the spring boot JAR so that things like auto configuration can pick it up.
Real World
In the real world, i'm trying to do this with:
- thymeleaf templates (e.g. my dependency JAR provides the HTML template files but in the deployed boot jar these templates are not resolved)
- liquibase changelog files (my dependency includes changelog files but these aren't executed - I presume liquibase autoconfig doesn't find the changelog file because it's not in the
src/main/resources
of the boot JAR).