Search code examples
spring-boottextjarwarpackaging

Wrapping a text file in a war and in a jar format


I have a springboot program that reads from a text file present inside the project. I use eclipse IDE. I want to share the project. While packaging the project in war format the text file was missing. Can someone tell me how do I package it so as to have the text file inside the package ? I want to know the steps for both war and jar packaging which will include the text file in them.

This will let the user who unpacks it finds the text file and it can be used by the springboot service directly.

Thanks


Solution

  • Put any resources (files) used at runtime in src/main/resources. They should be available in all packages.