title: spring-boot-maven-plugin spring-boot.run.main-class is ignored (Groovy)
body: <p>I have a spring-boot application with 2 main class as follows. </p>
  
  <pre><code>package org.arunm.springwebfluxrestservice.client
  
  
  import org.springframework.boot.autoconfigure.SpringBootApplication
  import org.springframework.boot.builder.SpringApplicationBuilder
  
  @SpringBootApplication
  class ReactiveClientApplication {
  
      public static void main(String[] args) {
          new SpringApplicationBuilder(ReactiveClientApplication)
              .properties(Collections.singletonMap("server.port","8081"))
              .run(args)
      }
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>package org.arunm.springwebfluxrestservice.webservice
  
  
  import org.springframework.boot.SpringApplication
  import org.springframework.boot.autoconfigure.SpringBootApplication
  import org.springframework.web.bind.annotation.RestController
  
  @SpringBootApplication
  @RestController
  class ReactiveServiceApplication {
  
      public static void main(String[] args) {
          SpringApplication.run(ReactiveServiceApplication)
      }
  }
  </code></pre>
  
  <p>spring-boot-maven-plugin is already included in pom.xml</p>
  
  <pre><code>&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;
  </code></pre>
  
  <p>I am trying to start <code>ReactiveClientApplication</code> using </p>
  
  <pre><code> mvn spring-boot:run -Dspring-boot.run.main-class=org.arunm.springwebfluxrestservice.client.ReactiveClientApplication
  </code></pre>
  
  <p>I get the error</p>
  
  <pre><code>[INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time:  4.297 s
  [INFO] Finished at: 2020-05-14T16:27:38+10:00
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.2.7.RELEASE:run (default-cli) on project spring-webflux-rest-service: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:2.2.7.RELEASE:run failed: Unable to find a single main class from the following candidates [org.arunm.springwebfluxrestservice.webservice.ReactiveServiceApplication, org.arunm.springwebfluxrestservice.client.ReactiveClientApplication] -&gt; [Help 1]
  org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.2.7.RELEASE:run (default-cli) on project spring-webflux-rest-service: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:2.2.7.RELEASE:run failed: Unable to find a single main class from the following candidates [org.arunm.springwebfluxrestservice.webservice.ReactiveServiceApplication, org.arunm.springwebfluxrestservice.client.ReactiveClientApplication]
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
      at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
      at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
      at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
      at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
      at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
      at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
      at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
      at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke (Method.java:566)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
      at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
  Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:2.2.7.RELEASE:run failed: Unable to find a single main class from the following candidates [org.arunm.springwebfluxrestservice.webservice.ReactiveServiceApplication, org.arunm.springwebfluxrestservice.client.ReactiveClientApplication]
      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:148)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
  
  </code></pre>
  
  <p>What am I doing wrong here ? </p>