develog

[spring boot] multiple properties file 본문

Dev/Spring Boot

[spring boot] multiple properties file

냐옴 2020. 8. 12. 23:12

ConfA.java

@Component
@PropertySource("classpath:properties/confA.properties")
public class ConfA {

    @Value("${aa.bb}")
    public String value;
}

 

ConfB.java

@Component
@PropertySource("classpath:properties/confB.properties")
public class ConfB {

    @Value("${cc.dd}")
    public String value;
}

 

properties files

resources
	properties
		confA.properties
		confB.properties

'Dev > Spring Boot' 카테고리의 다른 글

[spring boot] 초기화 코드  (0) 2020.11.01
[spring boot 2.3] javax.validation dependency  (0) 2020.10.25
Spring Boot jar, docker build  (0) 2020.08.06
[spring boot] static file read  (0) 2020.02.13
[spring boot] @SpringBootTest, MockMvc  (0) 2020.02.07
Comments