码上敲享录 > maven开发经验分享 > 打包时报错repackage failed: Unable to find a single main class from the following candidates

打包时报错repackage failed: Unable to find a single main class from the following candidates

上一章章节目录下一章 2019-10-14已有832人阅读 评论(0)

打包时报错repackage failed: Unable to find a single main class from the following candidates


解决方法:

因为多个类都有main方法,pom.xml加上一下配置:

<configuration>

    <mainClass>com.wlg.admin.AdminApplication</mainClass>

</configuration>



如下所示:

<build>

       <plugins>

           <plugin>

               <groupId>org.springframework.boot</groupId>

               <artifactId>spring-boot-maven-plugin</artifactId>

               <configuration>

                 <mainClass>com.wlg.admin.AdminApplication</mainClass>

               </configuration>

           </plugin>

           <!-- 跳过单元测试 -->

           <plugin>

               <groupId>org.apache.maven.plugins</groupId>

               <artifactId>maven-surefire-plugin</artifactId>

               <configuration>

                   <skipTests>true</skipTests>

               </configuration>

           </plugin>

       </plugins>

   </build>


向大家推荐《Activiti工作流实战教程》:https://xiaozhuanlan.com/activiti
向大家推荐《ireport实战教程》:https://xiaozhuanlan.com/ireport?rel=6923152725
0

有建议,请留言!

  • *您的姓名:

  • *所在城市:

  • *您的联系电话:

    *您的QQ:

  • 咨询问题:

  • 提 交