未知的生命周期阶段在执行Maven命令时。

huangapple go评论70阅读模式
英文:

Unknown lifecycle phase while executing maven command

问题

我正在使用 openjdk 17.6 (temurin 17) 和 maven 3.9.3 来运行我的 karate 框架,但在执行 men 命令时出现以下错误:

未知的生命周期阶段 .env。您必须指定有效的生命周期阶段

Maven 命令:

Mvn clean test -Dkarate.env=“qa” -Dkarate.options=“—-tags@sampletest”

不确定为什么 mvn 命令会失败,请帮忙解决。

添加附加详细信息:

已对 pom 文件进行以下更改:

<maven.compiler.version>3.10.1</maven.compiler.version>
<maven.surefire.plugin>3.1.0</maven.surefire.plugin>
<karate.version>1.4.1RC2</karate.version>
<aspectj.version>1.8.10</aspectj.version>

出现以下问题:

无法执行目标 org.apache.maven.plugin:3.10.1:testCompile
编译致命错误:无效的目标版本 17
英文:

I am using openjdk 17.6(temurin 17) and maven 3.9.3 to run my karate framework and I am getting following error while executing men command

Unknown lifecycle phase .env. You must specify valid lifecycle phase

Maven command
Mvn clean test -Dkarate.env=“qa” -Dkarate.options=“—-tags@sampletest”

Not sure why mvn command is failing.please help

Adding additional detials

following changes have been made to pom file

&lt;maven.compiler.version&gt;3.10.1&lt;/maven.compiler.version&gt;
&lt;maven.surefire.plugin&gt;3.1.0&lt;/maven.surefire.plugin&gt;
&lt;karate.version&gt;1.4.1RC2&lt;/karate.version&gt;
&lt;aspectj.version&gt;1.8.10&lt;/aspectj.version&gt;

getting following issue
Failed to execute goal org.apache.maven.plugin:3.10.1:testCompile
Fatal error compiling: Invalid target release 17

答案1

得分: 2

将"-Dkarate.en=“qa”"替换为"-Dkarate.env=“qa”"。

英文:

Replace -Dkarate.en=“qa” to -Dkarate.env=“qa”

答案2

得分: 0

-Dkarate.options="—t @sampletest"

英文:

Try:

-Dkarate.options=&quot;—t @sampletest&quot;

huangapple
  • 本文由 发表于 2023年7月11日 06:36:03
  • 转载请务必保留本文链接:https://go.coder-hub.com/76657730.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定