title: springboot How to exclude configuration class in dependency dependency
body: <p>I am using a library dependency which contains a <code>@configuration</code> class that I need to be ignored.</p>
  
  <p>When I do </p>
  
  <pre><code>@SpringBootApplication(exclude={NeedsToBeExcluded.class})
  public class Startup {
    public static void main(String[] args) {
      SpringApplication.run(Startup.class, args);
  }
  </code></pre>
  
  <p>I get the Exception</p>
  
  <blockquote>
    <p>nested exception is java.lang.IllegalStateException: The following classes could not be excluded because they are not auto-configuration classes: NeedsToBeExcluded.class</p>
  </blockquote>