如图出现如下错误:

解决方法如下:

1、(未测试)在pom.xml添加如下配置:

<build>
<defaultGoal>compile</defaultGoal>
</build>

2、直接在运行的命令行上加入:

//执行
mvn clean compile test
//打包
mvn clean compile test package

错误分析:

其实使用命令行时就已经指定了phase,而使用m2eclipse的【Run As】-【Maven build】时并未为其指定goal或phase,所以才报这个错误。但是一般这个是老版本才会出现,新版的eclipse已经没有这个问题,在运行时可以添加参数运行,效果和命令行保持一致。

Maven错误:“No goals have been specified for this build...”问题解决的更多相关文章

  1. maven 错误No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format

    [INFO] Scanning for projects... [INFO] ------------------------------------------------------------- ...

  2. Maven :No goals have been specified for this build

    Maven报错 报错信息如下:No goals have been specified for this build 解决办法:在<build></build>标签中增加  & ...

  3. Maven 错误:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project appservice-common: Fatal error compiling: 无效的目标发行版: 1.8

    通过IDEA 提供的面板 执行package 或者 install 没有错误,但是cmd terminal 窗口就不行!出现: Maven 错误:Failed to execute goal org. ...

  4. Maven报错 解决方案。ERROR: No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id

    报错: [ERROR] No goals have been specified for this build. You must specify a valid lifecycle phase or ...

  5. 运行maven build报错No goals have been specified for this build.

    运行maven报错: [ERROR] No goals have been specified for this build. You must specify a valid lifecycle p ...

  6. Maven 错误 Failure to transfer ...was cached in the local repository...

    Maven 错误 Failure to transfer ...was cached in the local repository... 我解决的时候多了两步才解决 1. mvn clean ins ...

  7. 运行Maven工程总是报错:No goals have been specified for this build

    Error info: No goals have been specified for this build. You must specify a valid lifecycle phase or ...

  8. 运行Maven是报错:No goals have been specified for this build

    No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in t ...

  9. 运行Maven时报错:No goals have been specified for this build

    No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in t ...

随机推荐

  1. JS一个非常经典的问题:在遍历数组时对DOM监听事件,索引值将始终等于遍历结束后的值

    一个简单的Tab选项卡点击事件. <style type="text/css"> ul{padding:0;margin:0;} .tab{width:400px;} ...

  2. python安装pattern失败

    做文本分类需要用到pattern.en进行词形还原,安装了一上午都没有成功,mysqlclient安装失败.最后解决办法,pip install --only-binary :all: mysqlcl ...

  3. Android之操作相册

    获取手机中的图片的绝对路径并且区分出每个文件夹下的路径: 存放图片绝对路径的文件夹的名字和存放绝对路径的List 实体类如下: import java.util.ArrayList; import j ...

  4. POJ3683 Priest John's Busiest Day 【2-sat】

    题目 John is the only priest in his town. September 1st is the John's busiest day in a year because th ...

  5. 挖煤(coal)

    挖煤(coal) solution 我好弱,啥也想不到. 想了很久dp,这有后效性啊. 结果倒着做就可以了,因为后面的不会影响前面的. 考虑前面的影响后面:挖煤相当于让后面所有a[I]*(1+k%) ...

  6. 秀秀的照片(photo)

    秀秀的照片(photo) 题目描述 华华在和秀秀视频时有截很多图.华华发现秀秀的每一张照片都很萌很可爱.为什么会这样呢?华华在仔细看过秀秀的所有照片后,发现秀秀的照片都具有一个相同的性质. 设秀秀的分 ...

  7. [暑假集训--数论]poj1365 Prime Land

    Everybody in the Prime Land is using a prime base number system. In this system, each positive integ ...

  8. css 文字垂直居中问题

    CSS 文字垂直居中问题 问题:在 div 中文字居中问题: 当使用 line-height:100%%; 时,文字没有居中,如下: html: <div id="header_log ...

  9. 【07】node 之 Buffer

    1.1.  Buffer基本概念 JavaScript 语言自身只有字符串数据类型,没有二进制数据类型.二进制可以存储电脑中任何数据(比如:一段文本.一张图片.一个硬盘,应该说电脑中所有的数据都是二进 ...

  10. SpringBoot中使用RestTemplate

    spring框架提供的RestTemplate类可用于在应用中调用rest服务,它简化了与http服务的通信方式,统一了RESTful的标准,封装了http链接, 我们只需要传入url及返回值类型即可 ...