zoukankan      html  css  js  c++  java
  • maven 打包异常

    异常信息:

    [ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.1.6.RELEASE:repackage (repackage) on project majb-common: Execution repackage of goal org.springframework.boot:spring-boot-mave
    n-plugin:2.1.6.RELEASE:repackage failed: Unable to find main class -> [Help 1]

    新建springboot 打包报错。 在网上找了很多帖子,发现很多原因都会导致这样的异常。 说一下我原因:

    项目结构:
    ----hello
    -----hello-web
    -----hello-service
    -----hello-dao
    -----hello-common
    

      

    web 依赖 service
    service依赖 dao
    dao依赖 common

    我的配置 在hello 下pom.xml 和 hello-web pom.xml 中 都有下面配置
    <build> <plugins>     <plugin>       <groupId>org.springframework.boot</groupId>       <artifactId>spring-boot-maven-plugin</artifactId>     </plugin> </plugins> </build>

      

    实际上hello 下 pom.xml 作为一个 顶级项目是不需要 这个配置的。

    打包的时候也不会从这个目录下打包,而是从hello-web 下打包

    所以 需要把 hello 下 pom.xml  中 maven-plugin 配置 删掉 就可以打包成功了。 我的问题是这个原因导致的

  • 相关阅读:
    Python基础
    熟悉常见的Linux操作
    大数据概述
    实验报告(3)-语法分析
    LL(1)文法
    简化版C语言文法
    实验报告(1)-词法分析
    中文词频统计
    综合练习:英文词频统计
    字符串练习
  • 原文地址:https://www.cnblogs.com/zhangXingSheng/p/11291745.html
Copyright © 2011-2022 走看看