如图出现如下错误:

解决方法如下:

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

  1. <build>
  2. <defaultGoal>compile</defaultGoal>
  3. </build>

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

  1. //执行
  2. mvn clean compile test
  3. //打包
  4. 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. Beats、Filebea入门

    1. Filebeat配置简介 2. Filebeat收集nginx日志 3. packetbeat简介与演示

  2. loj2091 「ZJOI2016」小星星

    ref 总的来说,就是 容斥转化为点对应到点集问题. 树形 dp 解决转化后的问题. #include <iostream> #include <cstring> #inclu ...

  3. 测试环境docker化—容器集群编排实践

    本文来自网易云社区 作者:孙婷婷 背景 在前文<测试环境docker化-基于ndp部署模式的docker基础镜像制作>中已经详述了docker镜像制作及模块部署的过程,按照上述做法已可以搭 ...

  4. 对CRC32的小结加上bugku一道题目:好多压缩包

    CRC32就是校验值,一般来说不同的文件校验值不一样,所以我们可以挨个爆破,当然这是在文件比较小的时候.下面是几种情形. 1. 我新建了一个flag.txt文档,里面是我的生日20180818 然后我 ...

  5. Monkey log异常分析说明

    以下主要针对在Android-Phone项目中进行Monkey log进行分析和说明,可以对bug提交作为参考. 要求熟悉,应用的包名.也就是说那个应用包出现问题,该属于那个模块,应用包名是判断依据. ...

  6. PostgreSQL 安装完成后的一些配置

    设置数据目录,一般使用环境变量 PGDATA 指向数据目录的根目录.目录的初始化是使用 initdb 来完成的,-D 后面加上自定义目录的路径 initdb -D /tmp/testpostgres2 ...

  7. 11 JVM 垃圾回收(上)

    引用计数法和可达性分析 垃圾回收,就是将已经分配出去的,但却不在使用的内存回收回来,以便再次分配.在 Java 虚拟机语境下,垃圾指的是死亡的对象所占据的堆空间.下面就总结一下如何如何辨别一个对象是否 ...

  8. random.nextInt方法用法

    1.不带参数的nextInt()会生成所有有效的整数(包含正数,负数,0) 2.带参的nextInt(int x)则会生成一个范围在0~x(不包含X)内的任意正整数 例如:int x=new Rand ...

  9. POJ3648 Wedding 【2-sat】

    题目 Up to thirty couples will attend a wedding feast, at which they will be seated on either side of ...

  10. windows api 程序

    #include "StdAfx.h" #include<windows.h> #include<mmsystem.h> LRESULT CALLBACK ...