如图出现如下错误:

解决方法如下:

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. windows下,cmd 运行 python 脚本,选中文字就停止运行了【已解决】

    参考资料: https://jingyan.baidu.com/article/ce09321bb95dda2bff858f26.html 问题原因: cmd 里面,快速编辑模式会暂停程序 解决步骤: ...

  2. WTForm

    Flask-WTForm: from flask import Flask,render_template,request,redirect from wtforms.fields import co ...

  3. Leetcode 516.最长回文子序列

    最长回文子序列 给定一个字符串s,找到其中最长的回文子序列.可以假设s的最大长度为1000. 示例 1:输入: "bbbab" 输出: 4 一个可能的最长回文子序列为 " ...

  4. Java学习6之泛型

    1.泛型定义 1.泛型类: public class Generic <T>{ public void get(T t){ System.out.println(t); } } examp ...

  5. js深度复制

    项目过程遇到需要对一个对象处理,然后独立出来用,结果怎么处理都会影响到原有变量,原来是引用导致,只有深度复制才行. 最终用下面的赋值方法才搞成功 var result=$.extend( true, ...

  6. PIC单片机之时钟设置

    PIC单片机之时钟设置 http://blog.csdn.net/superanters/article/details/8541650 内部时钟和外部时钟? PIC单片机有许多型号可以设置成 用外部 ...

  7. 妹子(girls)

    妹子(girls) 题目描述 万人迷皮皮轩收到了很多妹子的礼物,由于皮皮轩觉得每个妹子都不错,所以将她们礼物的包装盒都好好保存,但长此以往皮皮轩的房间里都堆不下了,所以只能考虑将一些包装盒放进其他包装 ...

  8. make gif pic

    http://www.cockos.com/licecap/ licecap 1.open licecap 2.record ,make a pic filename,like pic1 3.work ...

  9. CSS Modules使用方法

    css modules调研 css模块化解决方案 抛弃css (Radium,jsxstyle,react-style) 利用js来管理样式依赖(css Modules) css模块化面临的问题 全局 ...

  10. http://store.microsoft.com/home.aspx

    原文发布时间为:2009-07-26 -- 来源于本人的百度文章 [由搬家工具导入] http://store.microsoft.com/home.aspx