microsoft / microsoft/vscode-java-debug

Failed to get sources when debugging multi module maven project in vscode

Đang mở
#1,266 4 bình luận 1 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

ai-triaged bug multimodule sourcemap
Ngôn ngữ chính
TypeScript
Star
591
Fork
429
Merge trung bình
1 ngày 9 giờ
Pull request đã merge (30 ngày)
19

Mô tả

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
  1. Open Java multi module maven project in VS code and wait until its fully loaded
  2. Setup the launch config to debug the project.
  3. Set breakpoints in the main and the other referenced modules.
  4. 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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện thiết lập đa mô-đun bằng pom.xml và launch.json được tham chiếu, với các breakpoint trong mô-đun chính và các mô-đun được tham chiếu. Điều tra cách sourcePaths phân giải source JAR được tạo trong target, sau đó xác minh rằng các breakpoint trong tất cả mô-đun hiển thị mã nguồn thay vì các lớp đã dịch ngược.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
java, vscode
Lĩnh vực
developer-experience, devtools
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.