redhat-developer / redhat-developer/vscode-java
Maven and Java Build Status Colliding
还没有人认领这个 Issue。
- 主要语言
- TypeScript
- 星标
- 2.3k
- 派生
- 546
- 平均合并
- 20 小时 1 分钟
- 30 天内合并 PR
- 11
描述
I'm not entirely sure when this started happening or if reporting this issue on the wrong Java extension, but I believe it has been at least a week or two, maybe longer. I use versions-maven-plugin from org.codehaus.mojo to automatically change my versions whenever I package my project. Up until recently, this has never been an issue.
The issue I'm experiencing is that I frequently (not always) run into an error while trying to package my project. What I believe is happening, is that vscode is automatically rebuilding as soon as it registers that the version has changed. The problem with this is I think is that Maven is still building, and they sometimes run into the issue of each messing with the same class file at the same time.
Example error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-jar-plugin:2.4:jar (default-jar) on project osrs-core: Error assembling JAR: java.lang.reflect.InvocationTargetException: /Users/palidino/Desktop/BattleScape/server/osrs-core/target/classes/com/palidinodh/osrscore/model/item/ItemArray.class -> [Help 1]
2nd package attempt, no changes:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project osrs-core: Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile failed.: NullPointerException -> [Help 1]
3rd attempt:
No errors. Sometimes takes more attempts, sometimes less.
Environment
- Operating System: MacOS Catalina
- JDK version: 1.8.0_191-b12
- Visual Studio Code version: 1.42.1
- Java extension version: 0.57.0
Steps To Reproduce
- Use org.codehaus.mojo build-helper-maven-plugin and versions-maven-plugin in build plugins during package phase to update versions.
- When the versions get changed, the java build status server is activated while maven is still working.
- Sometimes get an error.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先,在报告中的 macOS、JDK、VS Code 和 Java 扩展版本上,使用 build-helper-maven-plugin 和 versions-maven-plugin 重现 Maven 的 package 阶段。调查 Maven 仍在运行时版本更改后 Java 构建状态服务器的激活情况;当重复执行 packaging 不再产生并发类文件错误时,该 issue 即完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- java, vscode
- 领域
- build-system, devtools
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 30/100