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

  • 相关阅读:
    负载均衡机制
    测试先行
    MVC模式在Java Web应用程序中的实例
    MVC模式学习
    Java反射机制
    软件开发火狐自动填写用户名和密码
    23种设计模式概述
    站立会议总结02
    站立会议总结01
    买书最低价问题
  • 原文地址:https://www.cnblogs.com/zhangXingSheng/p/11291745.html
Copyright © 2020-2023  润新知