redhat-developer / redhat-developer/vscode-java

Unexpected "JRE container" entry derived from pom.xml for Java SE 13

未关闭
#951 4 条评论 4 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

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

描述

When opening a Maven project which uses maven.compiler.source/target 13, the derived .classpath file uses J2SE-1.5 as its JRE container, instead of the expected JavaSE-12.

In other words: if the value for the Maven compiler properties is unsupported/unrecognized, it should default to the highest currently-supported version. This is much more likely to be what the user wants/expects. For example, with the new JDK release cadence (the first JDK 14 build is already released), it's more common (for me at least) to try out early-access JDK builds.

Environment
  • Operating System: Windows 10 Pro 1809 (17763.557)
  • JDK version: 12.0.1
  • Visual Studio Code version: 1.35.1
  • Java extension version: 0.46.0
Steps To Reproduce
  1. unzip and open sample-maven-project.zip
  2. let the extension generate the project files
Current Result

The .classpath file contains the following:

	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
		<attributes>
			<attribute name="maven.pomderived" value="true"/>
		</attributes>
	</classpathentry>
Expected Result

The .classpath file contains the following:

	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-12">
		<attributes>
			<attribute name="maven.pomderived" value="true"/>
		</attributes>
	</classpathentry>

贡献指南

打开贡献指南

从这里开始

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

调研方向

首先跟踪 pom.xml 中的 Maven 编译器属性是如何被读取并转换为生成的 .classpath 文件中的 JRE 容器的。使用链接的示例 Maven 项目重现该问题,并检查不受支持的版本是否会选择最高的受支持 Java 版本,而不是 J2SE-1.5。

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

评估

技术栈
java
领域
build-system
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

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