Spring: filtering component scan

To narrow resources to be scanned:

<context:component-scan base-package="com.mszynkiewicz.app">
      <context:include-filter type="regex" expression="com\.mszynkiewicz\.app\.included1.*"/>
      <context:include-filter type="regex" expression="com\.mszynkiewicz\.app\.included2.*"/>
      <context:exclude-filter type="regex" expression="com\.mszynkiewicz\.app\.excluded"/>
      <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
      <!-- todo: check if it can be a custom annotation
      <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
      -->
</context:component-scan>
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s