简体   繁体   English

在 VS Code 上启动 maven 插件并附加调试器

[英]Launch maven plugin and attach debugger on VS Code

I want to run a maven plugin in debug mode on VS Code, right now I'm launching the plugin using the following command on a terminal:我想在 VS Code 上以调试模式运行 maven 插件,现在我在终端上使用以下命令启动插件:

mvnDebug org.codehaus.cargo:cargo-maven3-plugin:1.9.7:run

Then I do attach the VS Code debugger using this settings:然后我使用以下设置附加 VS Code 调试器:

{
            "type": "java",
            "name": "Tomcat Debug",
            "request": "attach",
            "hostName": "127.0.0.1",
            "port": "8000"
},

Is there any way I can launch the maven plugin with debugger directly on VS Code?有什么办法可以直接在 VS Code 上使用调试器启动 maven 插件吗?

(using launch.json, not the vs code maven plugin) (使用launch.json,而不是vs code maven 插件)

Specify the mainClass and select the name in debug option, click the green triangle button then you can get the maven project run and debugging:在调试选项中指定mainClass并选择名称,点击绿色三角形按钮即可运行maven项目并进行调试:

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM