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

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 Mar 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
Community showcase
Published Aug 21, 2018 in Bitbucket

Branch Management with Bitbucket

As a project manager, I have discovered that different developers want to bring their previous branching method with them when they join the team. Some developers are used to performing individual wo...

2,374 views 9 12
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you