日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

解决IntelliJ IDEA下Maven报错Unknown lifecycle phase “.test.skip=true“. You must specify a valid lifecycle

發(fā)布時(shí)間:2024/4/13 编程问答 27 豆豆
生活随笔 收集整理的這篇文章主要介紹了 解决IntelliJ IDEA下Maven报错Unknown lifecycle phase “.test.skip=true“. You must specify a valid lifecycle 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

解決IntelliJ IDEA下Maven報(bào)錯(cuò)Unknown lifecycle phase ".test.skip=true". You must specify a valid lifecycle phase or a goal in the format

??筆者使用 IntelliJ IDEA 中的終端(Terminal)來運(yùn)行跳過單元測試時(shí)的命令 mvn package -Dmaven.test.skip=true 時(shí),發(fā)現(xiàn)總是報(bào)如下的錯(cuò):

筆者報(bào)錯(cuò)時(shí)的運(yùn)行環(huán)境:

  • JDK 17
  • Maven 3.6.3
  • IntelliJ IDEA 2021.2.2 (Ultimate Edition)
[ERROR] Unknown lifecycle phase ".test.skip=true". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<p lugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, genera te-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integr ation-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

??原來是因?yàn)?IntelliJ IDEA 的終端默認(rèn)使用 PowerShell 來運(yùn)行命令,而在 PowerShell 下,參數(shù) -Dmaven.test.skip=true 沒有被正確地識(shí)別。

??不過這只需要加在此參數(shù)外加單引號(hào)即可,即:mvn package '-Dmaven.test.skip=true'。也可以選擇將 IntelliJ IDEA 的終端設(shè)置成 CMD 模式(Command Prompt),不過筆者通常不喜歡這樣做,畢竟 PowerShell 比原始的 CMD 要強(qiáng)大。

總結(jié)

以上是生活随笔為你收集整理的解决IntelliJ IDEA下Maven报错Unknown lifecycle phase “.test.skip=true“. You must specify a valid lifecycle的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。