首页 > 解决方案 > 如何在 VSCode 上运行自定义空手道项目

问题描述

我正在使用自定义 Java 库在 IntelliJ 上编写一个测试项目。是否可以通过 VSCode 运行它以使用空手道插件的调试功能?如果我尝试运行它,我会收到以下错误:

[INFO] Scanning for projects...
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven- 
metadata.xml
Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml
Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml 
(20 kB at 23 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven- 
metadata.xml (14 kB at 15 kB/s)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  3.954 s
[INFO] Finished at: 2020-10-27T16:50:14+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix '.options=c' in the current project and in the plugin groups 
[org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local 
(C:\Users\asd\.m2\repository), central (https://repo.maven.apache.org/maven2)] -> [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/NoPluginFoundForPrefixException
The terminal process "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -Command mvn clean 
test -f "c:\Users\asd\Documents\test-karate\com.testK\com.testK-karate\pom.xml" - 
Dtest=_SyncRunner "-Dkarate.options=c:\Users\asd\Documents\test-karate\com.testK\com.testK- 
karate\src\test\java\test.feature" " 
terminated with exit code: 1.

该项目在 IntelliJ 上正常运行。

标签: karate

解决方案


从命令中可以清楚地看出您正在使用 Powershell。请将 VS Code 的“默认 shell”切换为cmd. 您可以在此处找到说明:https ://github.com/intuit/karate/wiki/Karate-Robot-Windows-Install-Guide#install-visual-studio-code

在此处输入图像描述


推荐阅读