microsoft / microsoft/vscode-java-debug
Failed to get sources when debugging multi module maven project in vscode
まだ誰も着手していません。
- 主要言語
- TypeScript
- スター
- 591
- フォーク
- 429
- 平均マージ
- 1日 9時間
- マージ済み PR(30日)
- 19
説明
I managed to open a multi-module maven project in VS Code and set up the launch.json correctly. I can debug the project and the breakpoints are respected in the main module. When I set a breakpoint in a referenced module, the execution will break, but I see a decompiled version of the class with the following comments:
// Failed to get sources. Instead, stub sources have been generated by the disassembler.
// Implementation of methods is unavailable.
I added the plugin in pom.xml for that module to generate the source from maven and the source. Then I used mvn clean install and the source code JAR was generated successfully under the target folder for the specific module.
I tried to launch the debug again, and nothing worked. I still see the decompiled version of the class.
I configured "sourcePaths" in launch.json to point to the generated source JAR and it didn't and didn't work. I tried to point to the folder, relative path, absolute path, and with/without the filename, but nothing worked.
I appreciate your help to find a resolution to this issue.
Environment
- Operating System: Windows 11
- JDK version: 1.8 and 18
- Visual Studio Code version: latest
- Java extension version:
- Java Debugger extension version:
Steps To Reproduce
- Open Java multi module maven project in VS code and wait until its fully loaded
- Setup the launch config to debug the project.
- Set breakpoints in the main and the other referenced modules.
- Start debug
[attach a sample project reproducing the error]
attach logs
Current Result
Breakpoint works only with the main module. The breakpoint in the other module works but source code is not used.
Expected Result
Breakpoint should work and source code should be displayed for all modules.
Additional Informations
I tried all possible steps to resolve this problem but nothing worked.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、参照されている pom.xml と launch.json を使ってマルチモジュール構成を再現し、メインモジュールと参照されているモジュールにブレークポイントを設定します。sourcePaths が target 配下の生成された source JAR をどのように解決するかを調査し、その後、すべてのモジュールのブレークポイントで逆コンパイルされたクラスではなくソースが表示されることを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java, vscode
- 領域
- developer-experience, devtools
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 25/100