The POM for 0.0.1-SNAPSHOT is missing, no dependency informat

本文介绍了在Maven项目中遇到的一个测试问题及其解决过程。主要包括:调整测试文件名以匹配类名;对依赖项目执行clean和testinstall操作;最后重新进行cleantest操作解决问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

解决方法:

       1、首先,更改了test文件的名字,保持它与类的名字相同

        2、对其依赖的maven项目进行clean和test install操作

        3、重新对自己设置的这个maven项目进行clean test操作,最后问题就解决了

PS D:\Java\mpdemos> mvn dependency:tree -Dincludes=com.baomidou [INFO] Scanning for projects... [INFO] [INFO] ------------------------< org.example:mpdemos >------------------------- [INFO] Building mpdemos 0.0.1-SNAPSHOT [INFO] from pom.xml [INFO] --------------------------------[ jar ]--------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 0.700 s [INFO] Finished at: 2025-03-24T22:53:38+08:00 [INFO] ------------------------------------------------------------------------ [ERROR] Unknown lifecycle phase ".baomidou". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin -artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: pre-clean, clean, post-clean, validate, initialize, generate-sources, process-sources, g enerate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, tes t-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-site, site, post-site, site-deploy. -> [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/LifecyclePhaseNotFoundException
03-25
[INFO] Scanning for projects... [INFO] [INFO] -------------< com.testingplaform:testing-plaform-backend >------------- [INFO] Building testing-plaform-backend 0.0.1-SNAPSHOT [INFO] --------------------------------[ jar ]--------------------------------- [WARNING] The artifact mysql:mysql-connector-java:jar:8.0.31 has been relocated to com.mysql:mysql-connector-j:jar:8.0.31: MySQL Connector/J artifacts moved to reverse-DNS compliant Maven 2+ coordinates. [INFO] [INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ testing-plaform-backend --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Using 'UTF-8' encoding to copy filtered properties files. [INFO] Copying 1 resource [INFO] Copying 2 resources [INFO] [INFO] --- maven-compiler-plugin:3.10.1:compile (default-compile) @ testing-plaform-backend --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 58 source files to f:\Testing Plaform\backend\target\classes [INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] /f:/Testing Plaform/backend/src/main/java/com/testingplaform/service/AutomationTestServiceImpl.java:[51,113] 闇€瑕?)'鎴?,',' [INFO] 1 error [INFO] ------------------------------------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1.247 s [INFO] Finished at: 2025-06-17T04:00:06+08:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.10.1:compile (default-compile) on project testing-plaform-backend: Compilation failure [ERROR] /f:/Testing Plaform/backend/src/main/java/com/testingplaform/service/AutomationTestServiceImpl.java:[51,113] 闇€瑕?)'鎴?,'[m [ERROR] [ERROR] -> [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/MojoFailureException f:\Testing Plaform\backend>mvn clean install [INFO] Scanning for projects... [INFO] [INFO] -------------< com.testingplaform:testing-plaform-backend >------------- [INFO] Building testing-plaform-backend 0.0.1-SNAPSHOT [INFO] --------------------------------[ jar ]--------------------------------- [WARNING] The artifact mysql:mysql-connector-java:jar:8.0.31 has been relocated to com.mysql:mysql-connector-j:jar:8.0.31: MySQL Connector/J artifacts moved to reverse-DNS compliant Maven 2+ coordinates. [INFO] [INFO] --- maven-clean-plugin:3.2.0:clean (default-clean) @ testing-plaform-backend --- [INFO] [INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ testing-plaform-backend --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Using 'UTF-8' encoding to copy filtered properties files. [INFO] Copying 1 resource [INFO] Copying 2 resources [INFO] [INFO] --- maven-compiler-plugin:3.10.1:compile (default-compile) @ testing-plaform-backend --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 58 source files to f:\Testing Plaform\backend\target\classes [INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] /f:/Testing Plaform/backend/src/main/java/com/testingplaform/service/AutomationTestServiceImpl.java:[51,113] 闇€瑕?)'鎴?,',' [INFO] 1 error [INFO] ------------------------------------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1.377 s [INFO] Finished at: 2025-06-17T04:01:00+08:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.10.1:compile (default-compile) on project testing-plaform-backend: Compilation failure [ERROR] /f:/Testing Plaform/backend/src/main/java/com/testingplaform/service/AutomationTestServiceImpl.java:[51,113] 闇€瑕?)'鎴?,'[m [ERROR] [ERROR] -> [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/MojoFailureException f:\Testing Plaform\backend> * 还原的历史记录 Microsoft Windows [版本 10.0.19045.4780] (c) Microsoft Corporation。保留所有权利。 F:\Testing Plaform>cd "f:\Testing Plaform\backend" f:\Testing Plaform\backend>mvn clear install [INFO] Scanning for projects... [INFO] [INFO] -------------< com.testingplaform:testing-plaform-backend >------------- [INFO] Building testing-plaform-backend 0.0.1-SNAPSHOT [INFO] --------------------------------[ jar ]--------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 0.198 s [INFO] Finished at: 2025-06-17T04:01:52+08:00 [INFO] ------------------------------------------------------------------------ [ERROR] Unknown lifecycle phase "clear". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [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/LifecyclePhaseNotFoundException
最新发布
06-18
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值