title: ClassNotFoundException for a class available in one of the jar from BOOT-INF/lib
body: <p>I have 2 spring-boot maven projects. The first project creates an extra jar using maven-jar-plugin, the pom.xml plugin part is as below.</p>
  
  <pre><code>&lt;plugin&gt;
      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
      &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt;
      &lt;executions&gt;
          &lt;execution&gt;
              &lt;phase&gt;package&lt;/phase&gt;
              &lt;goals&gt;
                  &lt;goal&gt;jar&lt;/goal&gt;
              &lt;/goals&gt;
              &lt;configuration&gt;
                  &lt;classifier&gt;beans&lt;/classifier&gt;
                  &lt;includes&gt;
                      &lt;include&gt;**/models/*&lt;/include&gt;
                      &lt;include&gt;**/exceptions/*&lt;/include&gt;
                  &lt;/includes&gt;
              &lt;/configuration&gt;
          &lt;/execution&gt;
      &lt;/executions&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>This creates "sample-0.0.1-SNAPSHOT-beans.jar" and also upload as artifact.</p>
  
  <p>The 2nd project is referring the above jar as a dependency. The pom.xml of 2nd project contains</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;com.abc&lt;/groupId&gt;
      &lt;artifactId&gt;sample&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;classifier&gt;beans&lt;/classifier&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>The build output of the 2nd project is an executable jar. when I explode this jar, it has BOOT-INF\lib and that lib contains sample-0.0.1-SNAPSHOT-beans.jar.</p>
  
  <p>However, when I execute 2nd project, it throws</p>
  
  <pre><code>java.lang.TypeNotPresentException: Type com.sample.models.AData not present
  at java.base/sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:117)
  at java.base/sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:125)
  at java.base/sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49)
  at java.base/sun.reflect.generics.visitor.Reifier.reifyTypeArguments(Reifier.java:68)
  at java.base/sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:138)
  at java.base/sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49)
  at java.base/sun.reflect.generics.repository.ClassRepository.computeSuperclass(ClassRepository.java:104)
  at java.base/sun.reflect.generics.repository.ClassRepository.getSuperclass(ClassRepository.java:86)
  at java.base/java.lang.Class.getGenericSuperclass(Class.java:955)
  at org.springframework.core.ParameterizedTypeReference.&lt;init&gt;(ParameterizedTypeReference.java:52)
  at com.sample.util.DataCacheUtil$1.&lt;init&gt;(DataCacheUtil.java:50)
  at com.sample.util.DataCacheUtil.getAData(DataCacheUtil.java:50)
  </code></pre>
  
  <p>I really do not get what is missing here, please help me out!</p>