redhat-developer / redhat-developer/vscode-java

Visual Studio Code deleting class files in target folder

未关闭
#2,909 1 条评论 5 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

compile enhancement Maven
主要语言
TypeScript
星标
2.3k
派生
546
平均合并
20 小时 1 分钟
30 天内合并 PR
11

描述

I'm working on multi module Maven project, i built in cmd using mvn clean install/deploy and the build is successful, all the class files in target\class folder are generated.

But when i import this project in VS Code, while opening the projects it is deleting all the class files i.e it deletes target\classes*com* folder in all the projects.

And, VS code doesn't resolve the dependencies in java files until the file is opened.

How do I fix this?

So, when the all the class files are deleted, it is unable to debug the code. While I try to run the code, it shows following error:

Error: Could not find or load main class com.application.Main Caused by: java.lang.ClassNotFoundException: com.application.Main

Environment
  • Operating System: Windows 10
  • JDK version: 11+
  • Visual Studio Code version: 1.74.3

贡献指南

打开贡献指南

从这里开始

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

调研方向

首先,在 Windows 10 上使用 JDK 11+ 和 VS Code 1.74.3,通过报告中的多模块 Maven 项目复现该问题。在项目打开时检查 target\classes 输出,然后验证依赖解析和调试是否能够恢复,同时不会删除生成的 com 文件。完成标准是确定原因,并记录或实现针对类文件被删除以及由此产生的 ClassNotFoundException 的修复。

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

评估

技术栈
java, vscode
领域
devtools
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

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