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

 

posted @ 2019-08-02 23:40  卖臭豆腐喽  阅读(553)  评论(0编辑  收藏  举报