Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upDebugger should allow user to specify launching cli command in launch.json #33
Comments
|
Suggest configuring @testforstephen, please see if this can address the problem. If so, we won't need to add |
|
@akaroml Yes, use |
|
Add a new task in tasks.json: "tasks": [
{
"taskName": "mvnDebug",
"type": "shell",
"command": "mvnDebug tomcat7:run",
"group": "build"
}
]
Then add {
"type": "java",
"name": "Debug (Attach)",
"request": "attach",
"hostName": "localhost",
"port": 8000,
"timeout": 30000,
"sourcePaths": [
"${workspaceRoot}"
],
"preLaunchTask": "mvnDebug"
}
Select the new debug configuration as default config and Click F5. It can launch spring mvc in debug mode. |
|
Can we ask vscode to add an event like "postDebugTask" to let the user do some cleanup works? |
|
The original issue can be resolved by adding preLaunchTask. It would be nicer if vscode provide an event to allow cleanups. But this issue can be closed for now. |
In order to debug spring mvc projects with vscode-java-debug, user need run
mvnDebug tomcat7:runon cmd first, then configure attach options in launch.json.Actually debugger can integrate the launch command in launch.json. And use
launchInTerminalfeature to execute the launching command in VSCode integrated terminal automatically. Then debugger attaches to the debug port to start debugging.