Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Files in main/resources in maven build aren't loaded

Laran Evans January 14, 2018

My application is a Java/maven application using spring boot.

I have csv files in main/resources that I read to load data when my application starts. I have other files in test/resources which are loaded as well. The files in test/resources seem to get loaded when I run a build. The files in main/resources do not. I get errors that the resource could not be loaded.

What configurations are available to load these files when running tests in the bitbucket pipeline?

The same maven build runs fine on my local machine.

1 answer

0 votes
Raul Gomis
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 28, 2018

Hi Laran,

I don't know exactly how you are accessing to the resource csv files. I recommend you use the ResourceLoader Sprint implementation to access the file. Here, you can see a tutorial on how to do it: https://smarterco.de/java-load-file-from-classpath-in-spring-boot/

Regards,

Raul

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events