Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @SpringBootApplication
- @EnableConfigurationProperties
- @ComponentScan
- public class MyApplication {
- @Bean(name="dmDs")
- @Primary
- @ConfigurationProperties("spring.datasource")
- public DataSource dmDataSource(){
- return DataSourceBuilder.create().build();
- }
- @Bean
- public String aBean(){
- DataSource ds = dmDataSource(); // creates a datasource with URL, username and password empty.
- return new String("");
- }
- spring:
- autoconfigure:
- exclude:
- - org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration
- - org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
- - org.springframework.boot.autoconfigure.jms.JndiConnectionFactoryAutoConfiguration
- - org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
- profiles:
- active: test
- ---
- spring:
- profiles: test
- datasource:
- url: jdbc:oracle:thin:SOME_URL
- driver-class-name: oracle.jdbc.OracleDriver
- password: test
- username: test
- datacollector:
- datasource:
- driver-class-name: oracle.jdbc.OracleDriver
- url: jdbc:oracle:thin:@SOME_URL
- username: user
- password: pass
- [main] o.s.c.e.PropertySourcesPropertyResolver : Found key 'spring.datasource.url' in [applicationConfig: [classpath:/application.yml]] with type [String]
- [main] o.s.c.e.PropertySourcesPropertyResolver : Found key 'spring.datasource.driver-class-name' in [applicationConfig: [classpath:/application.yml]] with type [String]
- [main] o.s.c.e.PropertySourcesPropertyResolver : Found key 'spring.datasource.password' in [applicationConfig: [classpath:/application.yml]] with type [String]
- [main] o.s.c.e.PropertySourcesPropertyResolver : Found key 'spring.datasource.username' in [applicationConfig: [classpath:/application.yml]] with type [String]
- JdbcTemplateAutoConfiguration matched:
- - @ConditionalOnClass found required classes 'javax.sql.DataSource', 'org.springframework.jdbc.core.JdbcTemplate' (OnClassCondition)
- - @ConditionalOnSingleCandidate (types: javax.sql.DataSource; SearchStrategy: all) found a primary bean from beans 'cipDs', 'dmDs' (OnBeanCondition)
- SpringApplication.run(new Object[]{DecisionManagementApplication.class,ApplicationConfig.class}, args);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement