Spring Boot access static resources missing scr/main/resources

Just use Spring type ClassPathResource. File file = new ClassPathResource(“countries.xml”).getFile(); As long as this file is somewhere on classpath Spring will find it. This can be src/main/resources during development and testing. In production, it can be current running directory. EDIT: This approach doesn’t work if file is in fat JAR. In such case you need … Read more