Anuj Vishwakarma
Anuj Vishwakarma

Reputation: 842

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.

Upvotes: 4

Views: 7520

Answers (1)

StanislavL
StanislavL

Reputation: 57381

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

@ComponentScan(value = {'your.package.here'}, excludeFilters = @Filter(ConfigurationToIgnore.class))

Upvotes: 8

Related Questions