title: NoClassDefFoundError: Could not initialize class org.slf4j.MDC
body: <p>How to fix <code>NoClassDefFoundError: Could not initialize class org.slf4j.MDC</code>? I have in <code>pom.xml</code> flyway plugin where <code>slf4j</code> is excluded in favor of newer one. </p>
  
  <pre><code>[INFO] |  \- org.slf4j:slf4j-simple:jar:1.5.6:compile
  [INFO] +- org.springframework:spring-beans:jar:4.1.4.RELEASE:compile
  [INFO] +- org.springframework:spring-core:jar:4.1.4.RELEASE:compile
  [INFO] |  \- commons-logging:commons-logging:jar:1.2:compile
  [INFO] +- org.springframework:spring-webmvc:jar:4.1.4.RELEASE:compile
  [INFO] |  +- org.springframework:spring-expression:jar:4.1.4.RELEASE:compile
  [INFO] |  \- org.springframework:spring-web:jar:4.1.4.RELEASE:compile
  [INFO] +- org.springframework:spring-tx:jar:4.1.4.RELEASE:compile
  [INFO] +- org.springframework:spring-jdbc:jar:4.1.4.RELEASE:compile
  [INFO] +- org.springframework:spring-orm:jar:4.1.4.RELEASE:compile
  [INFO] +- org.springframework:spring-context:jar:4.1.4.RELEASE:compile
  [INFO] |  \- org.springframework:spring-aop:jar:4.1.4.RELEASE:compile
  [INFO] |     \- aopalliance:aopalliance:jar:1.0:compile
  [INFO] +- ch.qos.logback:logback-classic:jar:1.1.2:compile
  [INFO] |  +- ch.qos.logback:logback-core:jar:1.1.2:compile
  [INFO] |  \- org.slf4j:slf4j-api:jar:1.7.6:compile
  [INFO] +- org.slf4j:jcl-over-slf4j:jar:1.7.10:compile
  </code></pre>
  
  <p><strong>pom.xml</strong></p>
  
  <pre><code>&lt;dependency&gt;
              &lt;groupId&gt;org.flywaydb.flyway-test-extensions&lt;/groupId&gt;
              &lt;artifactId&gt;flyway-spring4-test&lt;/artifactId&gt;
              &lt;version&gt;3.1&lt;/version&gt;
              &lt;exclusions&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
                      &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
              &lt;/exclusions&gt;
          &lt;/dependency&gt;
  
  &lt;dependency&gt;
              &lt;groupId&gt;ch.qos.logback&lt;/groupId&gt;
              &lt;artifactId&gt;logback-classic&lt;/artifactId&gt;
              &lt;version&gt;${logback.version}&lt;/version&gt;
          &lt;/dependency&gt;
  &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;jcl-over-slf4j&lt;/artifactId&gt;
              &lt;version&gt;${jcloverslf4j.version}&lt;/version&gt;
          &lt;/dependency&gt;
  </code></pre>