diff --git a/src/main/java/eu/dnetlib/repo/manager/config/Config.java b/src/main/java/eu/dnetlib/repo/manager/config/Config.java index 57eb1bc..d441b20 100644 --- a/src/main/java/eu/dnetlib/repo/manager/config/Config.java +++ b/src/main/java/eu/dnetlib/repo/manager/config/Config.java @@ -1,13 +1,24 @@ package eu.dnetlib.repo.manager.config; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.ImportResource; -import org.springframework.context.annotation.PropertySource; -import org.springframework.context.annotation.PropertySources; +import org.bouncycastle.util.Arrays; +import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; +import org.springframework.context.annotation.*; +import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; +import org.springframework.core.io.support.PathMatchingResourcePatternResolver; + +import java.io.IOException; @Configuration @ImportResource("classpath*:/gr/uoa/di/driver/app/springContext-commons.xml") -@PropertySource(value = "classpath*:/gr/**/springContext-*.properties", ignoreResourceNotFound = true) -@PropertySource(value = "classpath*:/eu/**/springContext-*.properties", ignoreResourceNotFound = true) public class Config { + + @Bean + public PropertySourcesPlaceholderConfigurer getPropertySourcesPlaceholderConfigurer() throws IOException { + PropertySourcesPlaceholderConfigurer ppc = new PropertySourcesPlaceholderConfigurer(); + + ppc.setLocations((new PathMatchingResourcePatternResolver().getResources("classpath*:/**/springContext-*.properties"))); + ppc.setIgnoreResourceNotFound(true); + + return ppc; + } }