未知的生命周期阶段“.mainClass=com.blobs.quickstart.App”
Unknown lifecycle phase ".mainClass=com.blobs.quickstart.App"
我 运行 通过这个演示(使用 PowerShell)。一切都很好,直到我 运行 这条线:
mvn exec:java -Dexec.mainClass="com.blobs.quickstart.App" -Dexec.cleanupDaemonThreads=false
然后我得到以下异常:
[INFO]
[INFO] --------------< com.blobs.quickstart:blob-quickstart-v12 >--------------
[INFO] Building blob-quickstart-v12 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.497 s
[INFO] Finished at: 2019-11-27T18:49:01-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Unknown lifecycle phase ".mainClass=com.blobs.quickstart.App". 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
的步骤 link
正如ManojReddy-MSFT建议的那样:
大多数情况下,这个错误是因为缺少插件http://www.mojohaus.org/exec-maven-plugin/index.html
你能验证一下你有没有这个插件吗?如果没有,你能试试这个插件吗?
也可以参考“Unknown lifecycle phase ”mvn“. You must specify a valid lifecycle phase or a goal” While Deploying the application using Azure
即使使用插件,我也收到了该错误消息。我通过更改双引号来修复它(我也在使用 Powershell):
mvn exec:java -D"exec.mainClass=my.main.Clazz" [other args with same quote pattern]
我 运行 通过这个演示(使用 PowerShell)。一切都很好,直到我 运行 这条线:
mvn exec:java -Dexec.mainClass="com.blobs.quickstart.App" -Dexec.cleanupDaemonThreads=false
然后我得到以下异常:
[INFO]
[INFO] --------------< com.blobs.quickstart:blob-quickstart-v12 >--------------
[INFO] Building blob-quickstart-v12 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.497 s
[INFO] Finished at: 2019-11-27T18:49:01-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Unknown lifecycle phase ".mainClass=com.blobs.quickstart.App". 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
的步骤 link
正如ManojReddy-MSFT建议的那样:
大多数情况下,这个错误是因为缺少插件http://www.mojohaus.org/exec-maven-plugin/index.html
你能验证一下你有没有这个插件吗?如果没有,你能试试这个插件吗?
也可以参考“Unknown lifecycle phase ”mvn“. You must specify a valid lifecycle phase or a goal” While Deploying the application using Azure
即使使用插件,我也收到了该错误消息。我通过更改双引号来修复它(我也在使用 Powershell):
mvn exec:java -D"exec.mainClass=my.main.Clazz" [other args with same quote pattern]