redhat-developer / redhat-developer/vscode-java

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

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

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

enhancement Maven upstream
Ngôn ngữ chính
TypeScript
Star
2.3k
Fork
547
Merge trung bình
20 giờ 1 phút
Pull request đã merge (30 ngày)
11

Mô tả

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>

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 theo dõi cách các thuộc tính trình biên dịch Maven trong pom.xml được đọc và chuyển đổi thành vùng chứa JRE trong tệp .classpath được tạo. Tái hiện sự cố với dự án Maven mẫu được liên kết và kiểm tra rằng một phiên bản không được hỗ trợ sẽ chọn phiên bản Java được hỗ trợ cao nhất thay vì J2SE-1.5.

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
Lĩnh vực
build-system
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/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.