How to override name of parent properties file?

36 Views Asked by At

There is parent project with additional module that I have to use in my project, it looks like this:

microservice-template
    microservice-parent
    microservice-jpa (it has application-jpa.properties file for config)
    microservice-jdbc
    microservice-abc

Now in my project I set parent of my main pom to

<parent>
    <groupId>com.bla.bla</groupId>
    <artifactId>microservice-parent</artifactId>
    <version>1.0.0</version>
</parent>

and in dependencies I want to use microservice-jpa

<dependency>
    <groupId>com.bla.bla</groupId>
    <artifactId>microservice-jpa</artifactId>
    <version>1.0.0</version>
</dependency>

The problem is, when I want to run tests in my project and use standard name application-test.properties then my project does not override application-jpa.properties from this microservice-jpa dependency. Properties are overrided only if I set my file to same name application-jpa.properties which looks weird in tests. How can I tell spring boot that I want to override properties from parent but with different file name?

0

There are 0 best solutions below