提示Unable to find a single main class from the following candidates错误的原因是会从所有代码里面扫描包括main方法的类,找到多个类就报错了。

解决办法是在pom.xml指定启动的类:

    <properties>
        <start-class>com.corp.MyApplication</start-class>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    </properties>

 

相关文章:

  • 2021-10-19
  • 2022-12-23
  • 2022-12-23
  • 2021-12-15
  • 2021-04-09
  • 2021-09-12
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-13
  • 2022-12-23
相关资源
相似解决方案