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 vote
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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

1,742 views 1 5
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