zoukankan      html  css  js  c++  java
  • spring boot 打包问题

    [INFO] Final Memory: 17M/225M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.0.0.RELEASE:repackage (default) on project demo-service: Execution default of goal org.springframework.boot:spring-boot-maven-plugin:2.0.0.RELEASE:repackage failed: Unable to find main class -> [Help 1]
    [ERROR]
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR]
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

    Process finished with exit code 1

    出现这种错误的原因是

    <build>
    <plugins>
    <plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    </plugin>
    </plugins>
    </build>
    这个插件,这里引入了spring-boot-maven-plugin,打包时会去扫描项目main方法入口,也就是说引入该配置,你就必须在项目src/main/java/下创建一个spring-boot启动类:

    解决方案:

    1. 添加spring-boot启动类。

    2. 将pom.xml中的spring-boot-maven-plugin相关配置注释掉

    3. pom.xml中spring-boot-maven-plugin相关配置修改为普通的maven--plugin配置即可。

  • 相关阅读:
    elk 之elasticsearch 部分参数参考(1)
    ubuntu16.04安装mariadb 缺少ncurses-devel
    死锁以及避免死锁
    python中的@
    Python中的logging模块
    Cannot find /usr/src/jdk1.7.0_79/lib/*.*/bin/setclasspath.sh 找不到文件
    shelve -- 用来持久化任意的Python对象
    Python-机器学习基础-K近邻算法
    Python-机器学习基础-Pandas
    Java-多线程
  • 原文地址:https://www.cnblogs.com/liubaihui/p/8966066.html
Copyright © 2011-2022 走看看