Given a Spring Boot Maven Project with this structure:
src main resources static file.txt This gets packaged into a jar file:
static file.txt I have tried the following ways to try to read file.txt:
File file = ResourceUtils.getFile("file.txt"); File file = ResourceUtils.getFile("/file.txt"); File file = ResourceUtils.getFile("static/file.txt"); File file = ResourceUtils.getFile("/static/file.txt"); None of these work.