Skip to content

Commit 11a6ee9

Browse files
committed
CC-3034: Customized the ES JarHell utility to ignore module-info files
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.
1 parent e3d090d commit 11a6ee9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/test/java/org/elasticsearch/bootstrap/JarHell.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,14 @@ public static void checkJavaVersion(String resource, String targetVersion) {
258258
}
259259

260260
static void checkClass(Map<String,Path> clazzes, String clazz, Path jarpath) {
261+
if (clazz.equals("module-info") || clazz.endsWith(".module-info")) {
262+
// Ignore jigsaw module descriptions
263+
return;
264+
}
265+
if (clazz.startsWith(JarHell.class.getName())) {
266+
// Obviously a duplicate of this class
267+
return;
268+
}
261269
Path previous = clazzes.put(clazz, jarpath);
262270
if (previous != null) {
263271
if (previous.equals(jarpath)) {

0 commit comments

Comments
 (0)