vscode generates compile errors for valid test-jar dependencies
維護者通常 4 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
先在 VS Code 中開啟 test-jar-issue-projects.zip,並載入兩個 Maven 專案,然後將診斷結果與只包含使用端專案的 workspace 進行比較。執行 mvn clean install 以確認專案有效;當兩個專案都存在時,本機 test-jar 匯入不再產生錯誤的編譯錯誤,即表示完成。
由索引模型根據 Issue 內容生成。
描述
I have a non shipping "utility" maven module. It has a dependency on classes from a test-jar produced by another module. If both the utility maven module and the test-jar producing module are loaded in the workspace, vscode generates compile errors for all imported test-jar classes. See the first screenshot below. Note that the compile errors in vscode are incorrect and should not exist. In contrast, running "mvn clean install" results in a successful build and IntelliJ handles this situation fine (there are no compile errors).
If however the module that produces the test jar is not loaded in the workspace, there are no compile errors for the imported test-jar classes in vscode. See the second screenshot below. In otherwords, the compile error only shows up when the test-jar producing module is in the workspace with the test-jar consuming module. Apparently vscode/eclipse jdt cannot resolve the test classes when they are from a local project and imported by another project's src/main classes.
I will attach 2 small maven projects to demonstrate the problem. You can load them into vscode to reproduce. You can also build them from the command line with mvn to confirm they are valid.
Compile error when both test-jar consuming and producing projects are in the workspace
No compile error when the test-jar producing project is not in the workspace
- 主要語言
- TypeScript
- 星號
- 2.3k
- 分支
- 547
- 平均合併
- 5 小時 36 分鐘
- 30 天內合併 PR
- 10
環境準備
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
redhat-developer/vscode-java 的其他 Issue
-
bug
難度 2/5 1-3 小時 新手友好度 75/100
redhat-developer/vscode-java#4511 ·
維護者通常 4 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
redhat-developer/vscode-java#4426 ·
維護者通常 4 天內回覆
-
bug
難度 4/5 3-5 天 新手友好度 45/100
redhat-developer/vscode-java#4506 · 6 則留言 · 4 個 reaction ·
維護者通常 4 天內回覆
-
bug
難度 4/5 3-5 天 新手友好度 45/100
redhat-developer/vscode-java#4505 · 5 則留言 · 2 個 reaction ·
維護者通常 4 天內回覆
-
難度 4/5 3-5 天 新手友好度 52/100
redhat-developer/vscode-java#4504 · 3 則留言 · 1 個 reaction ·
維護者通常 4 天內回覆
查看 redhat-developer/vscode-java 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 84/100
opengovsg/FormSG#10118 · 1 則留言 ·
維護者通常 1 天內回覆
-
ai-driven-qa bug claude
難度 1/5 1 小時以內 新手友好度 75/100
linagora/twake-calendar-frontend#1434 · 1 則留言 ·
維護者通常 1 天內回覆
-
check:passed streams:add
難度 2/5 1-3 小時 新手友好度 70/100
維護者通常 1 天內回覆
-
難度 2/5 半天 新手友好度 78/100
jaegertracing/jaeger-ui#4512 ·
維護者通常 1 天內回覆
-
area:ide documentation enhancement platform:macos platform:vscode
難度 1/5 1-3 小時 新手友好度 88/100
anthropics/claude-code#97389 ·
維護者通常 1 天內回覆