最近在使用spring-boot整合多模块,但是在父pom中打包maven install时总会报错:Failed to execute goal org.springframework.boot:spring-boot-maven-plugin,导致错误的原因是父pom.xml中引入了如下配置:

<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启动类:

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan; @SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}

主意:入口类上一定要加上注解@SpringBootApplication

解决方案:

1. 添加spring-boot启动类。

2. 将pom.xml中的spring-boot-maven-plugin相关配置注释掉

3. pom.xml中spring-boot-maven-plugin相关配置修改为普通的maven--plugin配置即可。

关于Springboot打包错误的问题 | Failed to execute goal org.springframework.boot:spring-boot-maven-plugin的更多相关文章

  1. maven打包 invalid entry size Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.5.14.RELEASE:repackage (default) on project

    打包失败,但是不知是具体是什么引起得,使用mvn -e clean package,定位到报错得代码 在定位到代码,打上断点,使用maven 打包debug模式 找到dubbo.properties, ...

  2. springboot错误1 Failed to execute goal org.springframework.boot:spring-boot-maven-plugin

    关于Springboot打包错误的问题 | Failed to execute goal org.springframework.boot:spring-boot-maven-plugin https ...

  3. Failed to execute goal org.springframework.boot

    报错 [ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.4.0.RELEASE:ru ...

  4. 【spring cloud】在spring cloud服务中,打包ms-core失败,报错Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.0.4.RELEASE:repackage (default) on project

    在spring cloud服务中,有一个ms-code项目,只为所有的微服务提供核心依赖和工具类,没有业务意义,作为核心依赖使用.所以没有main方法,没有启动类. 在spring cloud整体打包 ...

  5. Springboot | Failed to execute goal org.springframework.boot:spring-boot-maven-plugin

    案例 今天搭建spring boot 环境时,使用mvn install ,出现Failed to execute goal org.springframework.boot:spring-boot- ...

  6. [转]maven打包报错:Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.5:test

    源文URL:http://blog.csdn.net/caiwenfeng_for_23/article/details/44514947 mvn compile  没有问题,mvn package的 ...

  7. maven打包报错:Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.5:test

    mvn package的时候报如下错误: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.5:test ...

  8. 【maven】在IDEA上 使用maven进行打包时报错:Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.10.3:jar

    报错内容如下: [INFO] ------------------------------------------------------------------------ [INFO] BUILD ...

  9. Maven 打包的时候报 Failed to execute goal org.codehaus.mojo:native2ascii-maven-plugin

    错误信息: [ERROR] Failed to execute goal org.codehaus.mojo:native2ascii-maven-plugin:1.0-alpha-1:native2 ...

随机推荐

  1. centos7 服务操作命令

    systemctl list-unit-files --type service --all 操作防火墙: https://www.jianshu.com/p/411274f96492 操作VNC: ...

  2. Delphi处理Http请求自定义Header

    在HTTP请求中,get方法是默认的,但在URL地址长度是有限的,请求方法能传送的数据也是有限的,一般get方法传递的数据不能大于2KB,当get请求方法传递的数据长度不能满足需求时,就需要采用另一种 ...

  3. 电梯间的谈话:3分钟快速回答CEO的问题

    想象一下,你在电梯里遇见了公司的CEO,他让你用3分钟来解释聚焦答案模式这个深奥的术语到底是什么意思.你可以这么说—— 为奠定一个正确的基调,让他酝酿好情绪听你说接下来的话,你可以这样开头: “总裁, ...

  4. React Native & Web APP

    React Native Build native mobile apps using JavaScript and React https://facebook.github.io/react-na ...

  5. 理解 Delphi 的类(十) - 深入方法[17] - 提前声明

    //要点17: 如果前面的方法要调用后面的方法, 后面的方法需要提前声明 function MyFunB(x: Integer): Integer; forward; {使用 forward 指示字提 ...

  6. python之工作举例:通过复制NC文件来造数据

    # 通过对NC文件复制来造数据 import os, shutil # 遍历的根目录 root_dir = "D:\\test_data\\DISASTER\\" # 获取NC文件 ...

  7. docker --Dockerfile--一些语法

    环境更换 环境变量(与声明的ENV声明),也可以在特定指令作为变量用来被解释 Dockerfile.转义也被处理,从字面上包含类似于变量的语法. 环境变量Dockerfile用 $variable_n ...

  8. BZOJ1916[USACO 2010 Open Gold 2.Water Slides]——DP+记忆化搜索

    题目描述 受到秘鲁的马丘比丘的新式水上乐园的启发,Farmer John决定也为奶牛们建 一个水上乐园.当然,它最大的亮点就是新奇巨大的水上冲浪.超级轨道包含 E (1 <= E <=15 ...

  9. BZOJ4455 ZJOI2016小星星(容斥原理+树形dp)

    相当于给树上的每个点分配一个编号使父亲和儿子间都有连边. 于是可以考虑树形dp:设f[i][j][k]为i号点的编号为j,其子树中编号集合为k的方案数.转移显然.然而复杂度3n·n3左右,具体我也不知 ...

  10. Js 百分比进度条

    [构想] CSS3 + JS CSS3控制进度 利用CSS3中的 @keyframes JS实现百分比 根据CSS来调整,时间 [页面代码] 第一种: 默认直接进入就是下载 CSS代码 body { ...