具体报错是这样的

mvn test [22:04:05]
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.200 s
[INFO] Finished at: 2021-10-02T14:04:16Z
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/home/project). Please verify you invoked Maven from the correct directory. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException

解决方案如下:

This error indicates that you tried to execute a goal which requires a POM but Maven didn't find a pom.xml file in the directory you invoked it from. In most cases, fixing this is merely a matter of changing the current directory in the command prompt to point at your project's base directory. If you don't want to change the current directory, you have to tell Maven explicitly where the POM to build resides like this:

mvn -f path/to/pom.xml <goals> ...

报错的原因是,maven 测试的位置不对,找不到pom.xml,这个错误表明试图执行一个需要pom.xml的目标,但是Maven在调用它的目录中没有找到pom.xml文件。

在大多数情况下,解决这个问题只需在命令提示符中更改当前目录,以指向项目的基本目录。如果你不想改变当前目录,你必须像这样明确地告诉Maven要构建的POM驻留在哪里,或者也可以直接进入pom.xml所在地的目录下进行maven测试。

mvn test BUILD FAILURE相关推荐

  1. mvn install BUILD FAILURE : Downloading from central: https://repo.maven.apache.org/maven2/org/sp...

    错误信息: D:\project\2018\ygb\ygb\server>mvn install [INFO] Scanning for projects... [INFO] [INFO] -- ...

  2. [maven报错]mvn clean install报错BUILD FAILURE

    问题描述:  PS C:\Users\mingt> mvn clean install [INFO] Scanning for projects... [INFO] -------------- ...

  3. gradle build connection reset or protocol_version build failure

    为什么80%的码农都做不了架构师?>>>    gradle build connection reset or protocol_version build failure Mav ...

  4. maven BUILD FAILURE的解决办法

    问题描述 在使用IDEA的maven创建项目时总是失败,错误信息如下截图所示: 从图中可以看到是maven出了问题,在控制终端中执行maven help:system命令,测试能否正常build项目, ...

  5. 使用mvn插件surefire 执行工程单元测试 出现OOM的解决分析

    遇到surefire问题,最好是去官方文档看资料,看说明,因为网上关于surefire的使用经验几乎没有的. 官方说明地址:http://maven.apache.org/plugins/maven- ...

  6. mvn编写主代码与测试代码

    maven编写主代码与测试代码 3.2 编写主代码 项目主代码和测试代码不同,项目的主代码会被打包到最终的构件中(比如jar),而测试代码只在运行测试时用到,不会被打包.默认情况下,Maven假设项目 ...

  7. Jar包冲突解决方法 Unknown lifecycle phase mvn Eclipse中执行maven命令

    1.如下图,右击需要执行maven命令的工程,选择"Debug As"或"Run As",再选择"Maven build..." 进行如上操 ...

  8. maven使用mvn命令创建项目异常java.lang.NoClassDefFoundError: org/apache/commons/collections/ExtendedProperties

    命令: mvn archetype:generate -DarchetypeArtifactId=jersey-quickstart-gri zzly2 -DarchetypeGroupId=org. ...

  9. Java error 62_java – Maven build和maven-failsafe-plugin – 分叉的VM在没有正确说再见的情况下终止...

    我使用Docker和 https://github.com/fabric8io/docker-maven-plugin进行集成测试. 在我的Windows 10(更新到Windows 10 1709之 ...

最新文章

  1. VS2012下基于Glut OpenGL glScissor示例程序:
  2. 方案 mysql 优点_mysql高可用方案分析
  3. phpstudy添加redis扩展
  4. c语言求e近似值精度在10e6,中石油2013秋季学期《C语言》补考在线适用于2014年4月...
  5. Day4 dict和set
  6. 传统量化与ai量化对比_量化AI偏差的风险
  7. android studio for android learning (五) 最新Activity理解与其生命周期
  8. Web前端的优点有哪些?为什么Web前端可以如此火爆?
  9. python制作一个超强的加密软件
  10. Linux 进程管理
  11. discuz制作自己的门户列表模板
  12. 15个在线网站检测工具
  13. leetcode 5230 Check If It Is a Straight Line
  14. 渗透测试体系学习——学习寄语
  15. 软件检测报告可用于即征即退政策
  16. 2021-11-03皮革制作与环保科技
  17. 解决模拟器方向键无法使用问题
  18. 超越 FPN 和 NAS-FPN!商汤港中文提出 FPG,特征金字塔网格强势登场!
  19. 【加餐】如何在SteamVR 2 中替换手部模型
  20. 张孝祥老师给我们上课之后的感想

热门文章

  1. HierarchicalDataTemplate
  2. 20145328《网络对抗》Web基础
  3. AngularJS - 自定义指令
  4. [转载] 七龙珠第一部——第125话 神将登场
  5. zend studio 9.0汉化
  6. Ubuntu下设置电信拨号上网(10.04版)
  7. MySQL注入中报错的利用
  8. Oracle调用webservice说明
  9. IT PRO的职业生涯
  10. Eclipse设置条件断点