如图出现如下错误:

解决方法如下:

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. java.util.ArrayList与java.util.Arrays$ArrayList区别

    本博客转载自:https://blog.csdn.net/maywehe/article/details/52553954 写demo的时候,为了避免用list.add方法,特意写了个数组然后转换成l ...

  2. win8 远程桌面时提示凭证不工作问题的终极解决办法

    环境说明 远程办公电脑(放置于公司.自用办公电脑.win8系统) 远程连接客户机(放置于家中.家庭日常所用.win8系统) 故障现象 最近在使用远程桌面连接公司的办公电脑时,突然发现win8系统总是无 ...

  3. Python subprocess.Popen中communicate()和wait()区别

    刚开始我是使用的wait(),但是当adb命令返回太多时,程序就会卡死,查询得知原因后,才使用了communicate(),communicate()返回一个元组:(stdoutdata, stder ...

  4. Monkey官方帮助翻译&介绍

    都说想学好就看原文,英文不好为了翻译这个可费了大劲了.表格从GOOGLE官网复制到WORD里编辑,结果贴上来格式全乱了,只得不弄表格了.表格中官网的事件不是最新的,比最新的少2个,具体我会另发一篇文章 ...

  5. Leetcode 553.最优除法

    最优除法 给定一组正整数,相邻的整数之间将会进行浮点除法操作.例如, [2,3,4] -> 2 / 3 / 4 . 但是,你可以在任意位置添加任意数目的括号,来改变算数的优先级.你需要找出怎么添 ...

  6. JVM虚拟机系列(一)类的加载

    JAVA虚拟机系列(一) 类的加载 目录 1 类的初始化过程 2 详解初始化时的各个阶段 一.类初始化的过程 先来看一个CLASS文件在整体生命周期里会遇到的阶段: xxxx.class ---> ...

  7. SQL SERVER存储引擎——04.数据

    4. SQL SERVER存储引擎之数据篇 (4.1)文件 (0)主数据文件.mdf初始文件大小至少为3MB,次要数据文件.ndf初始大小,同日志文件一样至少为512KB: (1)SQL SERVER ...

  8. WebService常用公共接口

    Web Service 一些对外公开的网络服务接口   商业和贸易: 1.股票行情数据 WEB 服务(支持香港.深圳.上海基金.债券和股票:支持多股票同时查询) Endpoint: http://we ...

  9. String类型的XML文件的格式化

    在接收到的xml报文中,未经过格式化,不好看 package org.zln.xml.format; import org.dom4j.Document; import org.dom4j.Docum ...

  10. eclipse快捷键补全

    Eclipse中 补全快捷键 默认Alt+/ 但是每个人习惯有所不同 我需要来修改自己熟悉的快捷键 windows->preferences->General->keys将Conte ...