Springboot repackage failed: Unable to find a single main class from the following candidates
2017-07-24 00:00
721 查看
repackage failed: Unable to find a single main class from the following candidates
解决:
情况1:
在pom.xml文件中加入主类,用于指定加载的主类(在properties中,加入一个start-class的属性,用于告诉spring boot maven plugin哪个类是入口类即可)
情况2:
多模块依赖时,如果类似common之类的module只作为依赖包,而无需作为springboot的application时,以下打包插件不应配置到顶级pom及common的pom中:
具体哪个module需要作为application则配到哪个module中则可。
解决:
情况1:
在pom.xml文件中加入主类,用于指定加载的主类(在properties中,加入一个start-class的属性,用于告诉spring boot maven plugin哪个类是入口类即可)
<properties> <start-class>com.itmuch.cloud.common.Application</start-class> </properties>
情况2:
多模块依赖时,如果类似common之类的module只作为依赖包,而无需作为springboot的application时,以下打包插件不应配置到顶级pom及common的pom中:
<plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin>
具体哪个module需要作为application则配到哪个module中则可。
相关文章推荐
- SpringBoot学习之一 Unable to find a single main class from the following candidates
- Maven使用package打包Spring Boot时出现:Unable to find a single main class from the following candidates的问题解决
- Unable to find a single main class from the following candidates
- Unable to find a single main class from the following candidates
- Unable to find a single main class from the following candidates
- Execution default of goal org.springframework.boot:spring-boot-maven-plugin:1.5.6.RELEASE:repackage failed: Unable to find main class
- spring boot打包时Unable to find a single main class的解决方法
- Spring Boot应用的Unable to find main class异常详解
- Caused by: java.lang.IllegalStateException: Unable to find a single main class from问题解决
- spring boot maven Unable to find main class
- 问题:Unable to find a javac compiler; com.sun.tools.javac.Main is not on the classpath.Perhaps JAVA_HOME does not point to the JDK
- Unable to find a javac compiler; com.sun.tools.javac.Main is not on the classpath.Perhaps JAVA_HOME does not point to the JDK
- Unable to find a javac compiler; com.sun.tools.javac.Main is not on the classpath.Perhaps JAVA_HOME
- 解决com.sun.tools.javac.Main is not on the classpath / Unable to find a javac compiler 的问题
- SpringBoot控制台程序不允许出现多个含main方法的类--Unable to find a single main class
- Unable to find a javac compiler; com.sun.tools.javac.Main is not on the classpath. Perhaps JAVA_HOME does not point to the JDK(转
- unable to find javac compiler;com.sun.tools.javac.Mainisnotontheclasspath的问题的解决
- Creating An Instance Of The Com Component With Clsid {b9425246-4131-11d2-be48-004005a04edf} From The Iclassfactory Failed Due To The Following Error
- The following error occurred during schema generation: Unable to load bytecode for class
- 修复VirtualBox "This kernel requires the following features not present on the CPU: pae Unable to boot – please use a kernel appropriate for your CPU"