[jvm] Add an Automatic Module Name for XGBoost
envgap__dmlc__xgboost-11792
01 / FAILURE SIGNATURE
As reported upstream
Specifically, Java can't derive the name from `xgboost4j_2.13-3.1.1.jar`. Normally it would be able to, but the `2.13`, the Scala version, makes it have this error:
Not a benchmark task.
- In a clean container the reported failure did not reproduce, or the known fix did not make the project run.
02 / ENVIRONMENT RECIPE
- Base commit
a1f9c111bef457406229ec5e1ff620c9085c01c3- Manifest
jvm-packages/xgboost4j-flink/pom.xml- Reproduce
Awaiting issue-specific recipe- Run under trace
Awaiting a meaningful runtime command
03 / ORIGINAL ISSUE TEXT
dmlc/xgboost #11792 · read the original issue
I am trying to use XGBoost from a Java project, but it's difficult to use along with `module-info.java`. The reason is that there is no module name for XGBoost, and the automatically generated one doesn't work with the Jar name. Specifically, Java can't derive the name from `xgboost4j_2.13-3.1.1.jar`. Normally it would be able to, but the `2.13`, the Scala version, makes it have this error: ``` Tue Nov 04 11:01:11 $ jar --describe-module --file xgboost4j_2.13-3.1.1.jar Unable to derive module descriptor for: xgboost4j_2.13-3.1.1.jar xgboost4j.2.13: Invalid module name: '2' is not a Java identifier ``` I believe the correct way to fix this is to add a MANIFEST.MF Entry like they did here: https://github.com/oshi/oshi/issues/1243 I am not familiar enough with Maven to know how to add it [but here is a try](https://github.com/carl-mastrangelo/xgboost/commit/cd902b5569b94e52d69d6126c7f43ea9936aa4ef). This [blog post](http://branchandbound.net/blog/java/2017/12/automatic-module-name/) describes how as well.
04 / LABELS
Labels from the report text only; not yet run
No supported category has been assigned.
Label rules and the text that matched
[]