From a987a6081102d2836d6077f89cbd92aa5f73510c Mon Sep 17 00:00:00 2001 From: iamdanfox Date: Tue, 8 May 2018 12:59:28 +0100 Subject: [PATCH] Allow jars to contain module-info.class files (#272) --- .../palantir/baseline/tasks/ClassUniquenessAnalyzer.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gradle-baseline-java/src/main/groovy/com/palantir/baseline/tasks/ClassUniquenessAnalyzer.java b/gradle-baseline-java/src/main/groovy/com/palantir/baseline/tasks/ClassUniquenessAnalyzer.java index 402efc71f..e2762c682 100644 --- a/gradle-baseline-java/src/main/groovy/com/palantir/baseline/tasks/ClassUniquenessAnalyzer.java +++ b/gradle-baseline-java/src/main/groovy/com/palantir/baseline/tasks/ClassUniquenessAnalyzer.java @@ -76,6 +76,12 @@ public void analyzeConfiguration(Configuration configuration) { continue; } + if (entry.getName().equals("module-info.class")) { + // Java 9 allows jars to have a module-info.class file in the root, + // we shouldn't complain about these. + continue; + } + String className = entry.getName().replaceAll("/", ".").replaceAll(".class", ""); HashingInputStream inputStream = new HashingInputStream(Hashing.sha256(), jarInputStream); ByteStreams.exhaust(inputStream);