Spring Boot [ Maven (Multi-modules) ] Application management.properties

Asked

Viewed 411 times

1

Well I have a little problem I have a project where I am using a project with Maven, Spring Boot. And inside the Maven I’m dividing the modules [multi-modules] as

ex.: Persistence and Web

The module Web depends on the module Persistence. (The two make use of Spring Boot)

When I build (run) the project Web the application properties is overwritten when compiling giving preference to what is used in the module "father" .

I can somehow bypass the application properties (Persistence), so that the application properties (Web) inherit that of the module (Persistence) and also use his own application properties ?

Ex. application.properties (Web):

Something as soon as I inherited the datasource

spring.recebeUmaTagAquiParaHerdar.datasource = true;

Project Package (Three of Project) :

| Build
| - pom.xml
| 
| - persistence
| | - pom.xml 
| | - application.properties
|
| - web
| | - pom.xml  //Tem dependência do projeto persistence
| | - application.properties

Well thank you so much for your help so far.

  • A curiosity: your application.properties works outside the classpath?

  • Hello Andersonb.Magellan so by default Spring it will not work outside classpath but you can rather pass a @Propertiessource if you want to point to an external file or something like that. Doc Spring link here

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.