apache / apache/arrow-java

[Java] Adapt to Java 9/9+ automatic module system

Đang mở
#379 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Type: enhancement
Ngôn ngữ chính
Java
Star
94
Fork
152
Merge trung bình
3 ngày 16 giờ
Pull request đã merge (30 ngày)
11

Mô tả

In Java 9/9+, within following module-info.java definition the build will fail by error:

```Java

module my.app {
exports my.app;

requires arrow.memory.core;
requires arrow.memory.unsafe;
}
```

The error:
> java: the unnamed module reads package org.apache.arrow.memory from both arrow.memory.core and arrow.memory.unsafe

It seems that JPMS requires a package to be read from at most one individual module. Ref: http://openjdk.java.net/projects/jigsaw/spec/sotms/#the-module-path. If so what we may have to do is to conduct a code clean up for our maven modules to make sure we don't populate codes in the same package into different libraries.

Also, as a more standardized practice, it's might be an option to put entries with name **Automatic-Module-Name** into manifest files to tell automatic module system to generate predefined module names rather than parsing from jar file name. Ref: https://docs.oracle.com/javase/9/docs/api/java/lang/module/ModuleFinder.html#automatic-modules

Note that it's not a goal for this topic to migrate to Java 9/9+.

**Reporter**: [Hongze Zhang](https://issues.apache.org/jira/browse/ARROW-12905) / @zhztheplayer

**Note**: *This issue was originally created as [ARROW-12905](https://issues.apache.org/jira/browse/ARROW-12905). Please see the [migration documentation](https://github.com/apache/arrow/issues/14542) for further details.*

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Start with the module-info.java example and the Maven modules that provide org.apache.arrow.memory, then review the linked migration documentation and JPMS references. Check how packages are split between arrow.memory.core and arrow.memory.unsafe and how manifest files are produced. Done means the duplicate-package failure is addressed and automatic module names are defined where appropriate without migrating the project to Java 9+.

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
Tái cấu trúc
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
20/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.