Keep resource file on root level in repackaged JAR file

Viewed 94

I'm using the Spring Boot Maven Plugin in my pom.xml and more precisely the repackage goal to create an executable jar: https://docs.spring.io/spring-boot/docs/1.4.1.RELEASE/maven-plugin/examples/repackage-classifier.html

This moves all application classes under BOOT-INF/classes in the JAR file.

In my case I have a file under my src/main/resources path, let's say it's src/main/resources/my-file.txt.

In a normal JAR file the above my-file.txt would be placed at root level in the JAR. When I repackage the JAR however, the file goes to BOOT-INF/classes/my-file.txt. This is a problem for me as I really need this file on root level in the JAR.

Is there a way to achieve what I'm looking for with maven somehow as I don't want to have to manually insert the file on root level into the JAR with a command afterwards?

Thanks!

0 Answers
Related