title: Stop Spring Boot from loading @Configuration file from dependency module (jar)
body: <p>I'm implementing a Spring boot application with a dependency to another spring module (jar) containing an @Configuration (AmcConfiguration.class) file I do NOT want loaded into the context. I've tried many variations of exclude examples 
  a few of which are as follows: </p>
  
  <pre><code>//exclude problem configuration class
  @SpringBootApplication(exclude={AmcConfiguration.class}) 
  </code></pre>
  
  <p>and...</p>
  
  <pre><code>//exclude problem bean from within problem configuration class
  @EnableAutoConfiguration
  @Configuration
  @ComponentScan(excludeFilters = @Filter(type = FilterType.ASSIGNABLE_TYPE, classes = IAmsClient.class)) 
  </code></pre>
  
  <p>and...</p>
  
  <pre><code>//exclude problem configuration class package
  @EnableAutoConfiguration
  @Configuration
  @ComponentScan(excludeFilters = @Filter(type = FilterType.REGEX, pattern="com.prot.mtrx.amc.config.*"))  
  </code></pre>
  
  <p>Also, I've made sure there are no package naming collisions.</p>
  
  <ul>
  <li>spring boot root = "com.prot.am.*</li>
  <li>dependency = "com.prot.mtrx.amc.*"</li>
  </ul>
  
  <p>I've been searching examples for a few days now and am running out of options. I went down the auto-configuration path but that seems much too complicated a solution to tell spring boot to not run one simple configuration class. </p>
  
  <p>From my logs, it looks like it might be embedded tomcat:</p>
  
  <pre><code>DEBUG o.a.tomcat.util.digester.Digester -   New match='mbeans-descriptors/mbean/operation/parameter'
  DEBUG o.s.c.a.ClassPathBeanDefinitionScanner - Identified candidate component class: file [C:\TestSuite\workspace-dev\MAMClient\target\classes\com\prot\mtrx\amc\config\AmcConfiguration.class]
  </code></pre>
  
  <p>What am I missing?</p>