-
Notifications
You must be signed in to change notification settings - Fork 25.2k
JarHell check fails for Java 9 libraries (module-info.class) #32985
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Pinging @elastic/es-core-infra |
@jamesdbaker I was able to reproduce this with log4j 2.10 but not 2.11 which elasticsearch uses since 0a67cb4 . Since this is just for testing you could probably configure your pom to use it as a workaround. I will open a PR to fix jar hell soon. |
@atorok - Thanks, I will check when I'm back in the office tomorrow. In my case though, I'm not sure log4j was the problem as the two JARs it's referencing don't include log4j. I think it's a more generic Java 9 problem. That said, hopefully whatever fix you put in place will solve both. I'll let you know the outcome of the workaround tomorrow. |
@jamesdbaker that's right, I was referring to the example from stack overflow. You could put the meta-info class in different packages to avoid the jar hell. The fix I did will fix you're project as well. |
@atorok Will this be backported to previous ES versions? If I understand correctly, anyone on an older version of ES cannot have more than one instance of |
We have backported this change to our 6.x branch which is the development branch for the next minor release, but we will not be taking this change back any further than that. |
The `module-info` files will appear in multiple JARs, and they are not duplicates. The ES JarHell utility that the Elasticsearch project uses in their tests and base classes for tests (which we inherit and use in our tests) doesn’t take the `module-info` files into account. A similar fix was made for and backported to all ES 6.x branches (see elastic/elasticsearch#32985), but it was intentionally not backported.
Elasticsearch version:
6.3.2, Build: default/zip/053779d/2018-07-20T05:20:23.451332Z, JVM: 9.0.4
JVM version:
java version "9.0.4"
Java(TM) SE Runtime Environment (build 9.0.4+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.4+11, mixed mode)
OS version:
Linux dendesk-0260147 4.15.0-32-generic # 35~16.04.1-Ubuntu SMP Fri Aug 10 21:54:34 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Description of the problem including expected versus actual behavior:
I'm developing a new ingest processor that uses two libraries written for Java 9. As they're written for Java 9, both have a module-info.class in the default package, but the JarHell check is detecting this and throwing an error.
As it is expected that module-info.class is found in the same place in multiple JARs, a exemption from the check is probably needed.
This has also been flagged by other users here: https://stackoverflow.com/questions/51217252/elasticsearch-6-3-0-jarhell-module-info-class
Steps to reproduce:
mvn test
The text was updated successfully, but these errors were encountered: