You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2019/08/15 18:02:11 UTC

[lucene-solr] 05/05: SOLR-13452: Fix a couple of bugs in the license checker.

This is an automated email from the ASF dual-hosted git repository.

markrmiller pushed a commit to branch jira/SOLR-13452_gradle_5
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 863594ae31b7d98ed891322193725029eb173694
Author: markrmiller <ma...@apache.org>
AuthorDate: Thu Aug 15 13:01:18 2019 -0500

    SOLR-13452: Fix a couple of bugs in the license checker.
---
 .../src/main/java/org/apache/lucene/gradle/LicenseCheckTask.java | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/buildSrc/src/main/java/org/apache/lucene/gradle/LicenseCheckTask.java b/buildSrc/src/main/java/org/apache/lucene/gradle/LicenseCheckTask.java
index d6f3c16..b9b4781 100644
--- a/buildSrc/src/main/java/org/apache/lucene/gradle/LicenseCheckTask.java
+++ b/buildSrc/src/main/java/org/apache/lucene/gradle/LicenseCheckTask.java
@@ -32,15 +32,14 @@ public class LicenseCheckTask extends DefaultTask {
   private static final int CHECKSUM_BUFFER_SIZE = 8 * 1024;
   private static final int CHECKSUM_BYTE_MASK = 0xFF;
   private static final String FAILURE_MESSAGE = "License check failed. Check the logs.\n"
-      + "If you recently modified ivy-versions.properties or any module's build.gradle,\n"
-      + "make sure you run \"ant clean-jars jar-checksums\" before running precommit.";
+      + "If you recently modified version.props or in some cases a module's build.gradle,\n"
+      + "make sure you run \"gw jarChecksums\" to regenerate checksum files.";
   private static final Map<Pattern, String> REPLACE_PATTERNS = new HashMap<>();
   static {
     REPLACE_PATTERNS.put(Pattern.compile("jetty([^/]+)$"), "jetty");
     REPLACE_PATTERNS.put(Pattern.compile("asm([^/]+)$"), "asm");
     REPLACE_PATTERNS.put(Pattern.compile("slf4j-([^/]+)$"), "slf4j");
-    REPLACE_PATTERNS.put(Pattern.compile("javax\\.servlet([^/]+)$"), "javax.servlet");
-    REPLACE_PATTERNS.put(Pattern.compile("(bcmail|bcprov)-([^/]+)$"), "\1");
+    REPLACE_PATTERNS.put(Pattern.compile("(?:bcmail|bcprov)-([^\\.]+)$"), "$1");
   }
 
   private Pattern skipRegexChecksum;
@@ -211,7 +210,9 @@ public class LicenseCheckTask extends DefaultTask {
     outer:
     for (LicenseType licenseType : LicenseType.values()) {
       String artifactName = artifact.getModuleVersion().getId().getName();
+      //System.out.println("artifact name:" + artifactName);
       for (Map.Entry<Pattern, String> entry : REPLACE_PATTERNS.entrySet()) {
+        //System.out.println("replace with:" + entry.getValue());
         artifactName = entry.getKey().matcher(artifactName).replaceAll(entry.getValue());
       }
       File licensePath = new File(licenseDirectory,