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配置即可。

  • 相关阅读:
    vue 前端处理监听关键字搜索
    小程序引入背景图片
    解决vue低版本安卓手机兼容性问题
    js和jq实现全选反选
    SVN使用教程
    CSS如何修改tr边框属性
    在小程序中使用md5
    jquery ajax在 IE8/IE9 中无效
    vue 选择图片(限定大小)上传到服务器
    当获取图片失败时候,显示默认图片
  • 原文地址:https://www.cnblogs.com/liubaihui/p/8966066.html
Copyright © 2011-2022 走看看