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 配置 删掉 就可以打包成功了。 我的问题是这个原因导致的

  • 相关阅读:
    Redis 代理 twemproxy
    redis sentinel 集群监控 配置
    RabbitMQ 消息队列 配置
    codis 新版本 CodisLabs 编译安装
    CentOS7 开源跳板机(堡垒机) Jumpserver
    tomcat 优化配置 java-8 tomcat-7
    CentOS 7 安装配置 NFS
    CentOS 7 x64 安装 Ceph
    自动化运维 Ansible
    Java之数据类型讲解
  • 原文地址:https://www.cnblogs.com/zhangXingSheng/p/11291745.html
Copyright © 2011-2022 走看看