From f218af506f1568c1d561b9dce32842e80b10fe0d Mon Sep 17 00:00:00 2001 From: Mike Drob Date: Fri, 16 Jun 2017 21:53:13 -0500 Subject: [PATCH] HBASE-16351 Improve error reporting for license failures --- hbase-assembly/pom.xml | 35 ++++++++++++++++++++++ .../src/main/resources/META-INF/LICENSE.vm | 8 +---- 2 files changed, 36 insertions(+), 7 deletions(-) diff --git a/hbase-assembly/pom.xml b/hbase-assembly/pom.xml index b0e6fb8400..1021cf8143 100644 --- a/hbase-assembly/pom.xml +++ b/hbase-assembly/pom.xml @@ -34,6 +34,7 @@ pom true + ${project.build.directory}/maven-shared-archive-resources/META-INF/LICENSE @@ -51,6 +52,40 @@ true + + check-aggregate-license + + process-resources + + enforce + + + + + + File license = new File("${license.aggregate.path}"); + + // Beanshell does not support try-with-resources, + // so we must close this scanner manually + Scanner scanner = new Scanner(license); + + while (scanner.hasNextLine()) { + if (scanner.nextLine().startsWith("WARNING")) { + scanner.close(); + return false; + } + } + scanner.close(); + return true; + + + License errors detected, for more detail find WARNING in + ${license.aggregate.path} + + + + + diff --git a/hbase-resource-bundle/src/main/resources/META-INF/LICENSE.vm b/hbase-resource-bundle/src/main/resources/META-INF/LICENSE.vm index f842d00c67..c58bfed99d 100644 --- a/hbase-resource-bundle/src/main/resources/META-INF/LICENSE.vm +++ b/hbase-resource-bundle/src/main/resources/META-INF/LICENSE.vm @@ -1576,7 +1576,7 @@ This product includes ${dep.name} licensed under the ${dep.licenses[0].name}. ${dep.licenses[0].comments} #if(!(${non_aggregate_fine.contains($dep.licenses[0].name)})) -Please check ^^^^^^^^^^^^ this License for acceptability here: +WARNING: Please check ^^^^^^^^^^^^ this License for acceptability here: https://www.apache.org/legal/resolved @@ -1596,12 +1596,6 @@ project website ${dep.url} project source ${dep.scm.url} - -## fail the template. If you're looking at the source LICENSE.vm -## file based on a stacktrace or exception message, you need to find -## the generated LICENSE file that has the actual dependency info printed. -#set($empty = []) -${empty[0]} #end #end #end -- 2.13.0