title: Caused by: java.lang.ClassNotFoundException: org.springframework.core.io.support.SpringFactoriesLoader
body: <p>I am running the code from the link: <a href="https://github.com/PacktPublishing/Mastering-Spring-Boot-2.0/tree/master/Chapter-07" rel="nofollow noreferrer">https://github.com/PacktPublishing/Mastering-Spring-Boot-2.0/tree/master/Chapter-07</a> without any changes, while building the code, its giving me the error.</p>
  
  <p>I am not able to understand what exactly is causing the issue. I thought of jars are corrupted, but it seem different issue though.</p>
  
  <p><strong>pom.xml</strong></p>
  
  <pre><code>&lt;parent&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
          &lt;version&gt;2.0.2.RELEASE&lt;/version&gt;
          &lt;relativePath/&gt; &lt;!-- lookup parent from repository --&gt;
      &lt;/parent&gt;
  
      &lt;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
          &lt;project.reporting.outputEncoding&gt;UTF-8&lt;/project.reporting.outputEncoding&gt;
          &lt;java.version&gt;1.8&lt;/java.version&gt;
          &lt;spring-cloud.version&gt;Finchley.BUILD-SNAPSHOT&lt;/spring-cloud.version&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
              &lt;artifactId&gt;spring-cloud-starter-netflix-eureka-client&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
              &lt;artifactId&gt;spring-cloud-starter-netflix-zuul&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;dependencyManagement&gt;
          &lt;dependencies&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-cloud-dependencies&lt;/artifactId&gt;
                  &lt;version&gt;${spring-cloud.version}&lt;/version&gt;
                  &lt;type&gt;pom&lt;/type&gt;
                  &lt;scope&gt;import&lt;/scope&gt;
              &lt;/dependency&gt;
          &lt;/dependencies&gt;
      &lt;/dependencyManagement&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
      &lt;repositories&gt;
          &lt;repository&gt;
              &lt;id&gt;spring-snapshots&lt;/id&gt;
              &lt;name&gt;Spring Snapshots&lt;/name&gt;
              &lt;url&gt;https://repo.spring.io/snapshot&lt;/url&gt;
              &lt;snapshots&gt;
                  &lt;enabled&gt;true&lt;/enabled&gt;
              &lt;/snapshots&gt;
          &lt;/repository&gt;
          &lt;repository&gt;
              &lt;id&gt;spring-milestones&lt;/id&gt;
              &lt;name&gt;Spring Milestones&lt;/name&gt;
              &lt;url&gt;https://repo.spring.io/milestone&lt;/url&gt;
              &lt;snapshots&gt;
                  &lt;enabled&gt;false&lt;/enabled&gt;
              &lt;/snapshots&gt;
          &lt;/repository&gt;
      &lt;/repositories&gt;
  </code></pre>
  
  <p><strong>and error below:</strong></p>
  
  <pre><code>[INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 6.330 s
  [INFO] Finished at: 2018-10-19T00:46:58+05:30
  [INFO] Final Memory: 42M/310M
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.0.2.RELEASE:repackage (default) on project api-zuul-service: Execution default of goal org.springframework.boot:spring-boot-maven-plugin:2.0.2.RELEASE:repackage failed: A required class was missing while executing org.springframework.boot:spring-boot-maven-plugin:2.0.2.RELEASE:repackage: org/springframework/core/io/support/SpringFactoriesLoader
  [ERROR] -----------------------------------------------------
  [ERROR] realm =    plugin&gt;org.springframework.boot:spring-boot-maven-plugin:2.0.2.RELEASE
  [ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
  [ERROR] urls[0] = file:/C:/Users/pc/.m2/repository/org/springframework/boot/spring-boot-maven-plugin/2.0.2.RELEASE/spring-boot-maven-plugin-2.0.2.RELEASE.jar
  [ERROR] urls[1] = file:/C:/Users/pc/.m2/repository/org/springframework/boot/spring-boot-loader-tools/2.0.2.RELEASE/spring-boot-loader-tools-2.0.2.RELEASE.jar
  [ERROR] urls[2] = file:/C:/Users/pc/.m2/repository/org/springframework/spring-core/5.0.6.RELEASE/spring-core-5.0.6.RELEASE.jar
  [ERROR] urls[3] = file:/C:/Users/pc/.m2/repository/org/springframework/spring-jcl/5.0.6.RELEASE/spring-jcl-5.0.6.RELEASE.jar
  [ERROR] urls[4] = file:/C:/Users/pc/.m2/repository/org/apache/commons/commons-compress/1.14/commons-compress-1.14.jar
  [ERROR] urls[5] = file:/C:/Users/pc/.m2/repository/org/apache/maven/maven-archiver/2.6/maven-archiver-2.6.jar
  [ERROR] urls[6] = file:/C:/Users/pc/.m2/repository/org/apache/maven/shared/maven-shared-utils/0.7/maven-shared-utils-0.7.jar
  [ERROR] urls[7] = file:/C:/Users/pc/.m2/repository/com/google/code/findbugs/jsr305/2.0.1/jsr305-2.0.1.jar
  [ERROR] urls[8] = file:/C:/Users/pc/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.21/plexus-interpolation-1.21.jar
  [ERROR] urls[9] = file:/C:/Users/pc/.m2/repository/org/eclipse/aether/aether-util/0.9.0.M2/aether-util-0.9.0.M2.jar
  [ERROR] urls[10] = file:/C:/Users/pc/.m2/repository/javax/enterprise/cdi-api/1.0/cdi-api-1.0.jar
  [ERROR] urls[11] = file:/C:/Users/pc/.m2/repository/org/sonatype/sisu/sisu-guice/3.1.0/sisu-guice-3.1.0-no_aop.jar
  [ERROR] urls[12] = file:/C:/Users/pc/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar
  [ERROR] urls[13] = file:/C:/Users/pc/.m2/repository/org/eclipse/sisu/org.eclipse.sisu.inject/0.0.0.M5/org.eclipse.sisu.inject-0.0.0.M5.jar
  [ERROR] urls[14] = file:/C:/Users/pc/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
  [ERROR] urls[15] = file:/C:/Users/pc/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
  [ERROR] urls[16] = file:/C:/Users/pc/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
  [ERROR] urls[17] = file:/C:/Users/pc/.m2/repository/org/apache/maven/shared/maven-common-artifact-filters/1.4/maven-common-artifact-filters-1.4.jar
  [ERROR] urls[18] = file:/C:/Users/pc/.m2/repository/org/apache/xbean/xbean-reflect/3.4/xbean-reflect-3.4.jar
  [ERROR] urls[19] = file:/C:/Users/pc/.m2/repository/log4j/log4j/1.2.12/log4j-1.2.12.jar
  [ERROR] urls[20] = file:/C:/Users/pc/.m2/repository/commons-logging/commons-logging-api/1.1/commons-logging-api-1.1.jar
  [ERROR] urls[21] = file:/C:/Users/pc/.m2/repository/com/google/collections/google-collections/1.0/google-collections-1.0.jar
  [ERROR] urls[22] = file:/C:/Users/pc/.m2/repository/junit/junit/4.12/junit-4.12.jar
  [ERROR] urls[23] = file:/C:/Users/pc/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar
  [ERROR] urls[24] = file:/C:/Users/pc/.m2/repository/org/codehaus/plexus/plexus-archiver/2.8.1/plexus-archiver-2.8.1.jar
  [ERROR] urls[25] = file:/C:/Users/pc/.m2/repository/org/codehaus/plexus/plexus-io/2.3.2/plexus-io-2.3.2.jar
  [ERROR] urls[26] = file:/C:/Users/pc/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.24/plexus-utils-3.0.24.jar
  [ERROR] urls[27] = file:/C:/Users/pc/.m2/repository/org/sonatype/plexus/plexus-build-api/0.0.7/plexus-build-api-0.0.7.jar
  [ERROR] urls[28] = file:/C:/Users/pc/.m2/repository/org/apache/maven/plugins/maven-shade-plugin/2.2/maven-shade-plugin-2.2.jar
  [ERROR] urls[29] = file:/C:/Users/pc/.m2/repository/org/sonatype/sisu/sisu-inject-bean/1.4.2/sisu-inject-bean-1.4.2.jar
  [ERROR] urls[30] = file:/C:/Users/pc/.m2/repository/org/sonatype/sisu/sisu-guice/2.1.7/sisu-guice-2.1.7-noaop.jar
  [ERROR] urls[31] = file:/C:/Users/pc/.m2/repository/asm/asm/3.3.1/asm-3.3.1.jar
  [ERROR] urls[32] = file:/C:/Users/pc/.m2/repository/asm/asm-commons/3.3.1/asm-commons-3.3.1.jar
  [ERROR] urls[33] = file:/C:/Users/pc/.m2/repository/asm/asm-tree/3.3.1/asm-tree-3.3.1.jar
  [ERROR] urls[34] = file:/C:/Users/pc/.m2/repository/org/jdom/jdom/1.1/jdom-1.1.jar
  [ERROR] urls[35] = file:/C:/Users/pc/.m2/repository/org/apache/maven/shared/maven-dependency-tree/2.1/maven-dependency-tree-2.1.jar
  [ERROR] urls[36] = file:/C:/Users/pc/.m2/repository/org/vafer/jdependency/0.7/jdependency-0.7.jar
  [ERROR] urls[37] = file:/C:/Users/pc/.m2/repository/commons-io/commons-io/1.3.2/commons-io-1.3.2.jar
  [ERROR] urls[38] = file:/C:/Users/pc/.m2/repository/asm/asm-analysis/3.2/asm-analysis-3.2.jar
  [ERROR] urls[39] = file:/C:/Users/pc/.m2/repository/asm/asm-util/3.2/asm-util-3.2.jar
  [ERROR] urls[40] = file:/C:/Users/pc/.m2/repository/com/google/guava/guava/11.0.2/guava-11.0.2.jar
  [ERROR] Number of foreign imports: 1
  [ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
  [ERROR]
  [ERROR] -----------------------------------------------------
  [ERROR] : org.springframework.core.io.support.SpringFactoriesLoader
  [ERROR] -&gt; [Help 1]
  org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.0.2.RELEASE:repackage (default) on project api-zuul-service: Execution default of goal org.springframework.boot:spring-boot-maven-plugin:2.0.2.RELEASE:repackage failed: A required class was missing while executing org.springframework.boot:spring-boot-maven-plugin:2.0.2.RELEASE:repackage: org/springframework/core/io/support/SpringFactoriesLoader
  -----------------------------------------------------
  </code></pre>