Unable to find a single main class from the following candidates

关于start-class,spring boot官方手册是这么说明的:

The plugin rewrites your manifest, and in particular it manages the Main-Class and Start-Class entries, so if the defaults don't work you have to configure those there (not in the jar plugin). The Main-Class in the manifest is actually controlled by the layout property of the boot plugin, e.g.

<build>
  ...
  <plugins>
    ...
    <plugin>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-maven-plugin</artifactId>
      <version>1.4.0.RELEASE</version>
      <configuration>
        <mainClass>${start-class}</mainClass>
        <layout>ZIP</layout>
      </configuration>
      <executions>
        <execution>
          <goals>
            <goal>repackage</goal>
          </goals>
        </execution>
      </executions>
    </plugin>
    ...
  </plugins>
  ...
</build>

所以,当你的默认方式不好用的时候,在properties中,加入一个start-class的属性,用于告诉spring boot maven plugin哪个类是入口类即可。

文/BeeNoisy(简书作者)
原文链接:http://www.jianshu.com/p/b521f819b06a
著作权归作者所有,转载请联系作者获得授权,并标注“简书作者”。

 

时间: 2024-09-23 19:03:07

Unable to find a single main class from the following candidates的相关文章

用Python的Django框架完成视频处理任务的教程_python

Stickyworld 的网页应用已经支持视频拨放一段时间,但都是通过YouTube的嵌入模式实现.我们开始提供新的版本支持视频操作,可以让我们的用户不用受制于YouTube的服务. 我过去曾经参与过一个项目,客户需要视频转码功能,这实在不是个容易达成的需求.需要大量的读取每一个视频.音讯与视频容器的格式再输出符合网页使用与喜好的视频格式. 考虑到这一点,我们决定将转码的工作交给 Encoding.com .这个网站可以免费让你编码1GB大小的视频,超过1GB容量的文件将采取分级计价收费. 开发

Deploy Web Apps with High Availability, Fault Tolerance, and Load Balancing on Alibaba Cloud

By Ngoi Se Keng, Alibaba Cloud Tech Share Author 1. Introduction High Availability (HA), Fault Tolerance (FT), and Horizontal Scale Friendly (HSF) are as equally important as to functionality for web applications to run and succeed today. Existing or

Debug with jdb

原文地址: http://www.javaworld.com/article/2077445/testing-debugging/debug-with-jdb.html Q: How do you use jdb (included in the JDK 1.2 package) effectively to debug Java programs? I've tried many times, but I am successful only in loading a class file t

Model/View Programming

http://doc.qt.digia.com/4.7/model-view-programming.html Model/View Programming Introduction to Model/View Programming Qt 4 introduced a new set of item view classes that use a model/view architecture to manage the relationship between data and the wa

Single Number:从数组中找出只出现一次的数字

[ 问题: ] Given an array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could you implement it without using extra memory? 翻译:给定一个整数数组,数组中所有元素都出现了两次,只有一个元素只出现

x265探索与研究(六):main()函数

x265探索与研究(六):main()函数           x265源码的入口函数是main(),本文分析main()的主要功能.首先给出main()函数的功能及其代码结构:其次给出main()函数源码以及分析:最后给出main()函数中的主要功能函数的具体功能.   1.main()函数的功能及其代码结构           main()函数的主要功能是解析参数并进行编码的一些准备工作,调用了如下几个重要的函数: (1)cliopt.parse()函数:解析参数 (2)api->encod

Android中调用startActivity结果导致:java.lang.RuntimeException: Unable to start activity ComponentInfo{xxx}

Android中调用startActivity结果导致:上网查了一下,总结如下: 第一种情况:java.lang.RuntimeException: Unable to start activity ComponentInfo{xxx}: java.lang.NullPointerException 错误代码: private int defaultDrawable=R.drawable.radio; private String defaultTitle=getString(R.string.

【RAC】ORA-15055: unable to connect to ASM instanceORA-12547: TNS:lost contact

rac 安装完成,关闭之后重启数据库遇到如下错误: oracle@rac1:/tmp>sqlplus "/as sysdba" SQL*Plus: Release 11.2.0.1.0 Production on Fri Sep 2 13:17:14 2011 Copyright (c) 1982, 2009, Oracle.  All rights reserved. Connected to an idle instance. SQL> startup ORA-0107

未解决Unable to use slave&amp;#39;s temporary directory /tmp - Can&amp;#39;t create/write to file &amp;#39;/tmp/SQL_LOAD-&amp;#39; (Err

  Login / Register Developer Zone Bugs Home Report a bug Statistics Advanced search Saved searches Tags Bug #62055 Race condition in check_temp_dir() from multiple mysqld instances Submitted: 2 Aug 2011 10:24 Modified: 19 Dec 2011 1:29 Reporter: Yosh