Search code examples
springspring-bootspring-boot-test

Spring Boot version 2.3.x src/test/resources removed


Seems in the Springboot version 2.3.x , they have removed the src/test/resources folder ,

I downloaded a skeleton from start.spring.io and did not see it , the current project structure is as below , in such a case how do I use a test specific property file , problem is even if I create a src/test/resources folder and put a test.property file in it , its not being found while I am running the test , Any help is greatly appreciated.

enter image description here

Options I chose while generating the skeleton project in start.spring.io

enter image description here


Solution

  • After a fair amount of research I found my answer , so the "resources" folder under src/test has been removed as part of the skeleton project that we could download from start.spring.io , but now they have included a new build task , well my project is in gradle but I am sure such is the case with Maven too , the name of this task in gradle is "processTestResources" , it copies whatever you have inside your src/test/resources folder to the <Project_HOME>/build/resources/test , which is in the classpath and you can access your resources as you could earlier , the only things is now you have to manually create the "resources" folder , now issue resolved , Thanks everyone for your inputs.

    enter image description here