Reputation: 173
I have this problem.
In my app, I have 2 projects, Bank and User that connect to the same database, then both projects are the same database configuration in their application.properties. I don't want duplicate the configuration, then I had thought I could put that database configuration on the other properties(common properties) and in both properties extend that configuration.`
In Both projects(Bank, User) I have the same database configuration, the unique difference is the server.port, my idea is to have other properties(common.properties) that contains the database configuration, Bank and user properties, extends the common properties and add only server.port
#database
spring.jpa.hibernate.ddl-auto=create-drop
spring.datasource.url=jdbc:mysql://${MYSQL_HOST:localhost}:42333/userDatabase
spring.datasource.username=username
spring.datasource.password=password
spring.datasource.driver-class-name =com.mysql.jdbc.Driver
#spring.jpa.show-sql: true
#server
server.port= 8090
My doubt It is possible to have inheritance between properties?
Thanks for your time and sorry for my englis, it is not my native languaje, Regards!
Upvotes: 0
Views: 568