spring-boot icon indicating copy to clipboard operation
spring-boot copied to clipboard

Move @ConfigurationProperties and supporting classes to Spring Framework

Open nniesen opened this issue 11 years ago • 7 comments

Move @ConfigurationProperties and supporting classes (like PropertiesConfigurationFactory) out of Spring Boot and into Spring Framework (or at least into their own module). The prefixed properties would be useful in library code where I don't want to pull in the entire spring-boot project.

nniesen avatar Jan 05 '15 20:01 nniesen

It seems like something that should have been an enhancement to @PropertySource.

nniesen avatar Jan 05 '15 20:01 nniesen

+1

Also Conditional Classes would be a good asset.

cemo avatar Jan 05 '15 22:01 cemo

Agreed. It seems there are many "little" features in boot that would be useful in framework.

Prefixed properties would also be helpful for #808. Maybe not the auto-configure portion, but it would help segregate properties for multiple Hibernate JPA repositories which is my current need.

nniesen avatar Jan 05 '15 22:01 nniesen

It's probably also worth raising an issue in the Spring Framework JIRA for this.

philwebb avatar Jan 06 '15 02:01 philwebb

SPR-13799 has been raised.

snicoll avatar Dec 17 '15 08:12 snicoll

@dsyer

My requirement needs a multiple datasources and i have configured with in application.yml. I am using Spring-Boot with JHispster in the project. i am using Spring-Boot's @ConfigurationProperties(prefix = "spring.datasource.mydb1.hikari") with multiple @ConfigurationProperties(prefix = "spring.datasource.mydb2.hikari") but unable to connect to the second Data Base.

Sample application.yml

spring: 
    datasource:
        mydb1:
        primary: true
            url: DataBase URL1
            name:
            username: myusername1
            password:  mypassword1
        mydb2: 
            url: DataBase URL2
            name:
            username: myusername2
            password:  mypassword2 

HariKiran9 avatar Sep 28 '16 12:09 HariKiran9

@HariKiran9 that doesn't look relevant at all to this issue., If you have usage questions, please go to StackOverflow.

dsyer avatar Sep 28 '16 23:09 dsyer