title: Spring boot maven plugin class not found
body: <p>I have three maven project one is pom package and other 2 are jar packaging here is the admin-aggreagator pom</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;com.sounds.bvs&lt;/groupId&gt;
      &lt;artifactId&gt;admin-aggregator&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;packaging&gt;pom&lt;/packaging&gt;
  
  
      &lt;modules&gt;
          &lt;module&gt;../admin-lib&lt;/module&gt;
          &lt;module&gt;../admin-rest&lt;/module&gt;
      &lt;/modules&gt;
  
  
      &lt;properties&gt;
          &lt;project.build.SourceEncoding&gt;UTF-8&lt;/project.build.SourceEncoding&gt;
          &lt;spring-boot-version&gt;2.0.4.RELEASE&lt;/spring-boot-version&gt;
          &lt;spring-version&gt;2.0.4.RELEASE&lt;/spring-version&gt;
          &lt;maven.compiler.source&gt;8&lt;/maven.compiler.source&gt;
          &lt;maven.compiler.target&gt;8&lt;/maven.compiler.target&gt;
          &lt;start-class&gt;com.sounds.bvs.AdminRestApp&lt;/start-class&gt;
      &lt;/properties&gt;
  
      &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.4.RELEASE&lt;/version&gt;
      &lt;/parent&gt;
  
      &lt;dependencyManagement&gt;
          &lt;dependencies&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;com.sounds.bvs&lt;/groupId&gt;
                  &lt;artifactId&gt;admin-lib&lt;/artifactId&gt;
                  &lt;version&gt;${project.version}&lt;/version&gt;
              &lt;/dependency&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;com.sounds.bvs&lt;/groupId&gt;
                  &lt;artifactId&gt;admin-rest&lt;/artifactId&gt;
                  &lt;version&gt;${project.version}&lt;/version&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;executions&gt;
                      &lt;execution&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;repackage&lt;/goal&gt;
                          &lt;/goals&gt;
                          &lt;configuration&gt;
                              &lt;classifier&gt;exec&lt;/classifier&gt;
                              &lt;mainClass&gt;${start-class}&lt;/mainClass&gt;
                          &lt;/configuration&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven.compiler.plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.8.0&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.8&lt;/source&gt;
                      &lt;target&gt;1.8&lt;/target&gt;
                      &lt;showDeprication&gt;true&lt;/showDeprication&gt;
                      &lt;showWarnings&gt;true&lt;/showWarnings&gt;
                  &lt;/configuration&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;
  
      &lt;pluginRepositories&gt;
          &lt;pluginRepository&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;/pluginRepository&gt;
          &lt;pluginRepository&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;/pluginRepository&gt;
      &lt;/pluginRepositories&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p>And the admin-rest pom.xml and its Main class  i'm not getting as what i'm missing as the ctrl-click is navigating to respective project and type search is able to find the main class in admin-rest project ctrl+shift+T is also getting still it is showing same,</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;parent&gt;
          &lt;groupId&gt;com.sounds.bvs&lt;/groupId&gt;
          &lt;artifactId&gt;admin-aggregator&lt;/artifactId&gt;
          &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;/parent&gt;
      &lt;artifactId&gt;admin-rest&lt;/artifactId&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.sounds.bvs&lt;/groupId&gt;
              &lt;artifactId&gt;admin-lib&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-web --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
              &lt;exclusions&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                      &lt;artifactId&gt;spring-boot-starter-tomcat&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
              &lt;/exclusions&gt;
          &lt;/dependency&gt;
          &lt;!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-jetty --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-jetty&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
  
      &lt;/dependencies&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>The Main Class AdminRestApp.java and i'm trying to run the admin-aggregator with </p>
  
  <pre><code>mvn clean spring-boot:run
  mvnw.cmd clean spring-boot:run
  ./mvnw spring-boot:run 
  </code></pre>
  
  <p>but none are working</p>
  
  <pre><code>package com.sounds.bvs;
  import org.springframework.boot.SpringApplication;
  import org.springframework.boot.autoconfigure.SpringBootApplication;
  @SpringBootApplication
  public class AdminRestApp {
  
      public static void main(String[] args) {
          SpringApplication.run(AdminRestApp.class, args);
      }
  }
  
  
  
  and the exception i see class not found exception i tried all which were from similar topic none helped, the start-class tag is also place and hard code the full path com.sounds.bvs.AdminRestApp in mainClass still that also did not help,
  </code></pre>
  
  <p>i have tried changing spring boot version as well as maven compiler plugin version that also dint helped please help is need very badly.</p>
  
  <p>earlier the package path was large com.sounds.bvs.admin.rest that time also same issue changed the package name also dint helped</p>
  
  <p>please let me know what i'm missing thanks in advance.</p>
  
  <pre><code>[INFO] Scanning for projects...
  [INFO] ------------------------------------------------------------------------
  [INFO] Reactor Build Order:
  [INFO] `enter code here`
  [INFO] admin-aggregator
  [INFO] admin-lib
  [INFO] admin-rest
  [INFO]                                                                         
  [INFO] ------------------------------------------------------------------------
  [INFO] Building admin-aggregator 0.0.1-SNAPSHOT
  [INFO] ------------------------------------------------------------------------
  [INFO] 
  [INFO] --- maven-clean-plugin:3.0.0:clean (default-clean) @ admin-aggregator ---
  [INFO] 
  [INFO] &gt;&gt;&gt; spring-boot-maven-plugin:2.0.4.RELEASE:run (default-cli) &gt; test-compile @ admin-aggregator &gt;&gt;&gt;
  [INFO] 
  [INFO] &lt;&lt;&lt; spring-boot-maven-plugin:2.0.4.RELEASE:run (default-cli) &lt; test-compile @ admin-aggregator &lt;&lt;&lt;
  [INFO] 
  [INFO] --- spring-boot-maven-plugin:2.0.4.RELEASE:run (default-cli) @ admin-aggregator ---
  [WARNING] 
  java.lang.ClassNotFoundException: com.sounds.bvs.AdminRestApp
      at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      at org.springframework.boot.maven.AbstractRunMojo$LaunchRunner.run(AbstractRunMojo.java:491)
      at java.lang.Thread.run(Thread.java:745)
  [INFO] ------------------------------------------------------------------------
  [INFO] Reactor Summary:
  [INFO] 
  [INFO] admin-aggregator ................................... FAILURE [ 42.358 s]
  [INFO] admin-lib .......................................... SKIPPED
  [INFO] admin-rest ......................................... SKIPPED
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 56.280 s
  [INFO] Finished at: 2018-08-10T00:43:37+05:30
  [INFO] Final Memory: 17M/111M
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.0.4.RELEASE:run (default-cli) on project admin-aggregator: An exception occurred while running. com.sounds.bvs.AdminRestApp -&gt; [Help 1]
  [ERROR] 
  [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
  [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  [ERROR] 
  [ERROR] For more information about the errors and possible solutions, please read the following articles:
  [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
  </code></pre>