未知的生命周期阶段maven

时间:2013-09-09 11:42:10

标签: maven-3

我是maven和camel的新手。

我尝试在骆驼书中执行这些例子。当我运行以下命令时,我收到此错误。

命令:

mvn test -Dtest= SpringTransformMethodTest

错误:

[ERROR] Unknown lifecycle phase "SpringTransformMethodTest". You must specify a valid lifecycle phase or a goal in the f
ormat <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle ph
ases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, proce
ss-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, ver
ify, 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.`

5 个答案:

答案 0 :(得分:24)

-Dtest=SpringTransformMethodTest之间可能存在空格。然后将其解释为2个而不是1个。

答案 1 :(得分:9)

这个错误也发生在我身上。我正在运行这个命令,它在mvn的参数之间没有空格来安装它的值。

使用此命令:

> mvn org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file 
-Dfile=C:\Users\arcones\Desktop\ojdbc7.jar 
-DgroupId=com.oracle 
-DartifactId=ojdbc7 
-Dversion=12.1.0.1 
-Dpackaging=jar 
-DlocalRepositoryPath=lib

我收到了这个错误:

  

[错误]未知的生命周期阶段&#34; .oracle&#34;。您必须指定有效的   生命周期阶段或格式目标:或   :[:] :.   可用的生命周期阶段是:验证,初始化,   生成源,流程源,生成资源,   process-resources,compile,process-classes,genera te-test-sources,   流程测试源,生成测试资源,流程测试资源,   test-compile,process-test-class es,test,prepare-package,package,   预集成测试,集成测试,集成后测试,验证,   安装,拆卸,预清洁,清洁,后清洁,现场前,网站,   后站点,站点部署。 - &GT; [帮助1]

通过在每个值中添加双引号来解决问题:

> mvn org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file 
-Dfile="C:\Users\arcones\Desktop\ojdbc7.jar" 
-DgroupId="com.oracle"
-DartifactId="ojdbc7"
-Dversion="12.1.0.1"
-Dpackaging="jar" 
-DlocalRepositoryPath="lib"
  

[INFO]建立成功

答案 2 :(得分:3)

如果参数名称不是单个“单词”,则可能还需要将其用引号引起来,如下所示:

mvn gatling:test -D"gatling.simulationClass"="my.package.PostmanSimulation"

答案 3 :(得分:0)

偶然键入:

  

MVN包裹

代替:

  

mvn软件包

收益/结果:

  

[错误]未知的生命周期阶段“包装”。 [...等...]

堆栈:GitBash + Windows10 + Maven3.5.4

答案 4 :(得分:0)

我也遇到了错误

[ERROR] Unknown lifecycle phase "pacakge". 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]

您可能输入了错误的命令 将'pacakge'更改为'package'

相关问题