Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to exclude spring configuration files with @Configuration for dependency on other project

I have a project say A[In Maven] which has dependency on project B[In Maven]. Now project B got some spring @Configuration[db configuration ] files which gets up when i build and deploy my project A but due to some config properties which I don't have in my project A it shows some error. So how can I exclude that configuration files in project A while using other dependency in project B.

like image 368
Anuj Vishwakarma Avatar asked Feb 04 '23 09:02

Anuj Vishwakarma


1 Answers

You can add excludeFilters in your component scan to skip the class

@ComponentScan(value = {'your.package.here'}, excludeFilters = @Filter(ConfigurationToIgnore.class))
like image 190
StanislavL Avatar answered Feb 08 '23 13:02

StanislavL