相关疑难解决方法(0)

无法在Microsoft Powershell中使用`mvn -D`参数运行Maven,但可以在命令提示符下运行

我试图从命令行构建我们的Web项目,但跳过测试.我正在使用该命令mvn clean install -Dmaven.test.skip=true.

当我从传统的黑白命令提示符(也称为DOS shell)运行该命令时,该命令有效,但是当我从"Windows PowerShell"命令运行它时,我收到以下错误:

[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>[:<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, prepar e-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-site, site, post-site, site-deploy, pre-clean, clean, po st-clean. -> [Help 1]

造成这种差异的原因是什么让PowerShell的行为与传统的命令提示符相似?

这是在Windows 7上运行的.

windows powershell command-line command maven

43
推荐指数
3
解决办法
1万
查看次数

标签 统计

command ×1

command-line ×1

maven ×1

powershell ×1

windows ×1