microsoft / microsoft/vscode-java-debug

Azure Function local debugging for multiple profile in maven

未关闭
#647 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

ai-triaged attach bug buildtool
主要语言
TypeScript
星标
591
派生
429
平均合并
1 天 9 小时
30 天内合并 PR
19

描述

Issue Type: Bug

##------------------##----------
Launch.json
{
"name": "Attach to Java Functions dev",
"type": "java",
"request": "attach",
"hostName": "127.0.0.1",
"port": 5005,
"preLaunchTask": "devFunc"
},
{
"name": "Attach to Java Functions test",
"type": "java",
"request": "attach",
"hostName": "127.0.0.1",
"port": 5005,
"preLaunchTask": "testFunc"
}

//#########------------#############
TASK.json
//#######------------------###########
{
"version": "2.0.0",
"tasks": [
{
"label": "devFunc",
"type": "func",
"command": "host start",
"problemMatcher": "$func-watch",
"isBackground": true,
"options": {
"cwd": "${workspaceFolder}/target/azure-functions/sequation-image-resize-functions-dev/"
},
"dependsOn": ["package-dev"]
},
{
"label": "package-dev",
"command": "mvn clean package",
"type": "shell",
"problemMatcher": [
"$func-watch"
],
"isBackground": true
}
,
{
"label": "testFunc",
"type": "func",
"command": "host start",
"problemMatcher": "$func-watch",
"isBackground": true,
"options": {
"cwd": "${workspaceFolder}/target/azure-functions/sequation-image-resize-functions-test/"
},
"dependsOn": ["package-test"]
},
{
"label": "package-test",
"command": "mvn clean package -P test",
"type": "shell"
}
]
}

I have multiple profiles in my maven for each environment that I have eg: dev, test, prod I have configured the tasks to build and run pointing to each profile I have in my maven.

the prelaunch task in Launch.json does not pick up the task based on its name if there are multiple tasks defined in the task.json. I have observed it picks up the task that is defined.

to make it run I have to comment out the multiple tasks and keep just one.

in the above configuration if I comment out the below code it works fine.

//,
// {
// "label": "testFunc",
// "type": "func",
// "command": "host start",
// "problemMatcher": "$func-watch",
// "isBackground": true,
// "options": {
// "cwd": "${workspaceFolder}/target/azure-functions/sequation-image-resize-functions-test/"
// },
// "dependsOn": ["package-test"]
// },
// {
// "label": "package-test",
// "command": "mvn clean package -P test",
// "type": "shell"
// }

Extension version: 0.21.0
VS Code version: Code 1.37.1 (f06011ac164ae4dc8e753a3fe7f9549844d15e35, 2019-08-15T16:17:55.855Z)
OS version: Windows_NT x64 10.0.17763

System Info
Item Value
CPUs Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz (8 x 2112)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
oop_rasterization: disabled_off
protected_video_decode: enabled
rasterization: enabled
skia_deferred_display_list: disabled_off
skia_renderer: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 15.86GB (6.46GB free)
Process Argv
Screen Reader no
VM 0%

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先,在 Launch.json 和 TASK.json 中使用多个条目重现该配置,使用 devFunc 和 testFunc 作为 preLaunchTask 名称,并使用它们的 Maven profile 命令。跟踪定义了多个任务时 Java 调试器如何解析 preLaunchTask。完成标准是每个启动配置都启动与其名称匹配的任务,而不是错误的任务。

由索引模型根据 Issue 内容生成。

评估

技术栈
azure, java, vscode
领域
developer-experience, devtools
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。