Add component scan to configuration file

This commit is contained in:
Konstantinos Triantafyllou 2021-12-06 15:20:43 +00:00
parent 5cc4834f5c
commit 1da1d75771
2 changed files with 11 additions and 23 deletions

View File

@ -1,14 +0,0 @@
package eu.dnetlib.uoaadmintoolslibrary;
import eu.dnetlib.uoaadmintoolslibrary.configuration.GlobalVars;
import eu.dnetlib.uoaauthorizationlibrary.configuration.AuthorizationConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import eu.dnetlib.uoaadmintoolslibrary.configuration.properties.GoogleConfig;
import eu.dnetlib.uoaadmintoolslibrary.configuration.properties.MailConfig;
import org.springframework.context.annotation.Import;
@SpringBootApplication//(scanBasePackages = {"eu.dnetlib.uoaauthorizationlibrary"})
@EnableConfigurationProperties({MailConfig.class, GoogleConfig.class, GlobalVars.class})
@Import(AuthorizationConfiguration.class)
public class UoaAdminToolsLibraryApplication {}

View File

@ -1,14 +1,16 @@
package eu.dnetlib.uoaadmintoolslibrary; package eu.dnetlib.uoaadmintoolslibrary;
import org.springframework.context.annotation.Bean; import eu.dnetlib.uoaadmintoolslibrary.configuration.GlobalVars;
import eu.dnetlib.uoaadmintoolslibrary.configuration.properties.GoogleConfig;
import eu.dnetlib.uoaadmintoolslibrary.configuration.properties.MailConfig;
import eu.dnetlib.uoaauthorizationlibrary.configuration.AuthorizationConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; import org.springframework.context.annotation.Import;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
@Configuration @Configuration
public class UoaAdminToolsLibraryConfiguration extends WebMvcConfigurerAdapter { @EnableConfigurationProperties({MailConfig.class, GoogleConfig.class, GlobalVars.class})
@Bean @ComponentScan(basePackages = { "eu.dnetlib.uoaadmintoolslibrary" })
public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() { @Import(AuthorizationConfiguration.class)
return new PropertySourcesPlaceholderConfigurer(); public class UoaAdminToolsLibraryConfiguration {}
}
}