From ef4a012cd1103f0dde8da0b7b8e25fc9a9c1ae05 Mon Sep 17 00:00:00 2001 From: Mike Drob Date: Thu, 6 Jul 2017 14:13:26 -0700 Subject: [PATCH] HBASE-12349 Add custom error-prone module --- hbase-annotations/pom.xml | 4 +- hbase-archetypes/pom.xml | 4 +- hbase-assembly/pom.xml | 4 +- hbase-assembly/src/main/assembly/src.xml | 4 +- hbase-build-configuration/pom.xml | 99 ++++++++++++++++++++++ hbase-build-support/hbase-error-prone/pom.xml | 61 +++++++++++++ .../hadoop/hbase/errorprone/AlwaysPasses.java | 44 ++++++++++ hbase-build-support/pom.xml | 78 +++++++++++++++++ hbase-client/pom.xml | 4 +- hbase-common/pom.xml | 4 +- hbase-endpoint/pom.xml | 4 +- hbase-examples/pom.xml | 4 +- hbase-external-blockcache/pom.xml | 4 +- hbase-hadoop-compat/pom.xml | 4 +- hbase-hadoop2-compat/pom.xml | 4 +- hbase-it/pom.xml | 4 +- hbase-metrics-api/pom.xml | 4 +- hbase-metrics/pom.xml | 4 +- hbase-prefix-tree/pom.xml | 4 +- hbase-procedure/pom.xml | 4 +- hbase-protocol-shaded/pom.xml | 4 +- hbase-protocol/pom.xml | 4 +- hbase-resource-bundle/pom.xml | 4 +- hbase-rest/pom.xml | 4 +- hbase-rsgroup/pom.xml | 4 +- hbase-server/pom.xml | 4 +- hbase-shaded/pom.xml | 4 +- hbase-shell/pom.xml | 4 +- hbase-spark-it/pom.xml | 4 +- hbase-spark/pom.xml | 4 +- hbase-testing-util/pom.xml | 4 +- hbase-thrift/pom.xml | 4 +- pom.xml | 36 ++------ 33 files changed, 348 insertions(+), 82 deletions(-) create mode 100644 hbase-build-configuration/pom.xml create mode 100644 hbase-build-support/hbase-error-prone/pom.xml create mode 100644 hbase-build-support/hbase-error-prone/src/main/java/org/apache/hadoop/hbase/errorprone/AlwaysPasses.java create mode 100644 hbase-build-support/pom.xml diff --git a/hbase-annotations/pom.xml b/hbase-annotations/pom.xml index 4dcf14349f..067356b7e2 100644 --- a/hbase-annotations/pom.xml +++ b/hbase-annotations/pom.xml @@ -21,10 +21,10 @@ --> 4.0.0 - hbase + hbase-build-configuration org.apache.hbase 3.0.0-SNAPSHOT - .. + ../hbase-build-configuration hbase-annotations diff --git a/hbase-archetypes/pom.xml b/hbase-archetypes/pom.xml index 474116467c..b0576ef129 100644 --- a/hbase-archetypes/pom.xml +++ b/hbase-archetypes/pom.xml @@ -22,10 +22,10 @@ --> 4.0.0 - hbase + hbase-build-configuration org.apache.hbase 3.0.0-SNAPSHOT - .. + ../hbase-build-configuration hbase-archetypes diff --git a/hbase-assembly/pom.xml b/hbase-assembly/pom.xml index 0d591a28af..14074ad7e7 100644 --- a/hbase-assembly/pom.xml +++ b/hbase-assembly/pom.xml @@ -21,10 +21,10 @@ --> 4.0.0 - hbase + hbase-build-configuration org.apache.hbase 3.0.0-SNAPSHOT - .. + ../hbase-build-configuration hbase-assembly Apache HBase - Assembly diff --git a/hbase-assembly/src/main/assembly/src.xml b/hbase-assembly/src/main/assembly/src.xml index e5d3faf1e4..436b1ff400 100644 --- a/hbase-assembly/src/main/assembly/src.xml +++ b/hbase-assembly/src/main/assembly/src.xml @@ -33,6 +33,8 @@ org.apache.hbase:hbase-annotations org.apache.hbase:hbase-archetypes + org.apache.hbase:hbase-build-support + org.apache.hbase:hbase-build-configuration org.apache.hbase:hbase-assembly org.apache.hbase:hbase-checkstyle org.apache.hbase:hbase-client @@ -71,7 +73,7 @@ - target/ + **/target/ test/ .classpath .project diff --git a/hbase-build-configuration/pom.xml b/hbase-build-configuration/pom.xml new file mode 100644 index 0000000000..0446d29d30 --- /dev/null +++ b/hbase-build-configuration/pom.xml @@ -0,0 +1,99 @@ + + + + 4.0.0 + + hbase + org.apache.hbase + 3.0.0-SNAPSHOT + .. + + + hbase-build-configuration + Apache HBase - Build Configuration + Configure the build-support artifacts for maven build + + pom + + + + + maven-assembly-plugin + + true + + + + + + + errorProne + + false + + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven.compiler.version} + + javac-with-errorprone + true + true + + -XepDisableWarningsInGeneratedCode + -Xep:FallThrough:OFF + + + + org.apache.hbase + hbase-error-prone + ${project.version} + + + + + + org.codehaus.plexus + plexus-compiler-javac-errorprone + ${plexus.errorprone.javac.version} + + + + com.google.errorprone + error_prone_core + ${error-prone.version} + + + org.apache.hbase + hbase-error-prone + ${project.version} + + + + + + + + diff --git a/hbase-build-support/hbase-error-prone/pom.xml b/hbase-build-support/hbase-error-prone/pom.xml new file mode 100644 index 0000000000..ce84476d17 --- /dev/null +++ b/hbase-build-support/hbase-error-prone/pom.xml @@ -0,0 +1,61 @@ + + + + 4.0.0 + + hbase-build-support + org.apache.hbase + 3.0.0-SNAPSHOT + .. + + org.apache.hbase + hbase-error-prone + 3.0.0-SNAPSHOT + Apache HBase - Error Prone Rules + Module to hold error prone custom rules for HBase. + + + + com.google.errorprone + error_prone_core + ${error-prone.version} + provided + + + com.google.code.findbugs + jsr305 + + + + + com.google.errorprone + error_prone_annotation + ${error-prone.version} + provided + + + com.google.auto.service + auto-service + 1.0-rc3 + true + + + diff --git a/hbase-build-support/hbase-error-prone/src/main/java/org/apache/hadoop/hbase/errorprone/AlwaysPasses.java b/hbase-build-support/hbase-error-prone/src/main/java/org/apache/hadoop/hbase/errorprone/AlwaysPasses.java new file mode 100644 index 0000000000..5778f2df8e --- /dev/null +++ b/hbase-build-support/hbase-error-prone/src/main/java/org/apache/hadoop/hbase/errorprone/AlwaysPasses.java @@ -0,0 +1,44 @@ +/** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.hadoop.hbase.errorprone; + +import com.google.auto.service.AutoService; +import com.google.errorprone.BugPattern; +import com.google.errorprone.VisitorState; +import com.google.errorprone.bugpatterns.BugChecker; +import com.google.errorprone.fixes.Fix; +import com.google.errorprone.fixes.SuggestedFix; +import com.google.errorprone.matchers.Description; +import com.google.errorprone.matchers.Matcher; +import com.sun.source.tree.CompilationUnitTree; +import com.sun.source.tree.ImportTree; + +@AutoService(BugChecker.class) +@BugPattern(name = "AlwaysPasses", + category = BugPattern.Category.JDK, + summary = "A placeholder rule that never matches.", + severity = BugPattern.SeverityLevel.ERROR, + suppressibility = BugPattern.Suppressibility.UNSUPPRESSIBLE, + linkType = BugPattern.LinkType.NONE) +public class AlwaysPasses extends BugChecker implements BugChecker.CompilationUnitTreeMatcher { + @Override + public Description matchCompilationUnit(CompilationUnitTree tree, VisitorState state) { + return Description.NO_MATCH; + } +} \ No newline at end of file diff --git a/hbase-build-support/pom.xml b/hbase-build-support/pom.xml new file mode 100644 index 0000000000..f13c3f1881 --- /dev/null +++ b/hbase-build-support/pom.xml @@ -0,0 +1,78 @@ + + + + 4.0.0 + + hbase + org.apache.hbase + 3.0.0-SNAPSHOT + .. + + + hbase-build-support + Apache HBase - Build Support + Parent module for build-support artifacts + + pom + + + true + + true + + true + + + hbase-error-prone + + + + + + + org.codehaus.mojo + findbugs-maven-plugin + + ${project.basedir}/../../dev-support/findbugs-exclude.xml + + + + + maven-assembly-plugin + + true + + + + + + + + maven-assembly-plugin + + true + + + + + diff --git a/hbase-client/pom.xml b/hbase-client/pom.xml index 45c43e99fb..23278bf369 100644 --- a/hbase-client/pom.xml +++ b/hbase-client/pom.xml @@ -22,10 +22,10 @@ --> 4.0.0 - hbase + hbase-build-configuration org.apache.hbase 3.0.0-SNAPSHOT - .. + ../hbase-build-configuration hbase-client diff --git a/hbase-common/pom.xml b/hbase-common/pom.xml index eb546178c8..84e120b71e 100644 --- a/hbase-common/pom.xml +++ b/hbase-common/pom.xml @@ -21,10 +21,10 @@ --> 4.0.0 - hbase + hbase-build-configuration org.apache.hbase 3.0.0-SNAPSHOT - .. + ../hbase-build-configuration hbase-common diff --git a/hbase-endpoint/pom.xml b/hbase-endpoint/pom.xml index a324af1bf9..29bd33b20f 100644 --- a/hbase-endpoint/pom.xml +++ b/hbase-endpoint/pom.xml @@ -21,10 +21,10 @@ --> 4.0.0 - hbase + hbase-build-configuration org.apache.hbase 3.0.0-SNAPSHOT - .. + ../hbase-build-configuration hbase-endpoint Apache HBase - Coprocessor Endpoint diff --git a/hbase-examples/pom.xml b/hbase-examples/pom.xml index 0522367630..7a6a51a9c6 100644 --- a/hbase-examples/pom.xml +++ b/hbase-examples/pom.xml @@ -21,10 +21,10 @@ --> 4.0.0 - hbase + hbase-build-configuration org.apache.hbase 3.0.0-SNAPSHOT - .. + ../hbase-build-configuration hbase-examples Apache HBase - Examples diff --git a/hbase-external-blockcache/pom.xml b/hbase-external-blockcache/pom.xml index 657dea7166..beab0fda61 100644 --- a/hbase-external-blockcache/pom.xml +++ b/hbase-external-blockcache/pom.xml @@ -23,10 +23,10 @@ --> 4.0.0 - hbase + hbase-build-configuration org.apache.hbase 3.0.0-SNAPSHOT - .. + ../hbase-build-configuration hbase-external-blockcache Apache HBase - External Block Cache diff --git a/hbase-hadoop-compat/pom.xml b/hbase-hadoop-compat/pom.xml index 6c2ab2aade..a027e5a762 100644 --- a/hbase-hadoop-compat/pom.xml +++ b/hbase-hadoop-compat/pom.xml @@ -21,10 +21,10 @@ --> 4.0.0 - hbase + hbase-build-configuration org.apache.hbase 3.0.0-SNAPSHOT - .. + ../hbase-build-configuration hbase-hadoop-compat diff --git a/hbase-hadoop2-compat/pom.xml b/hbase-hadoop2-compat/pom.xml index 30639958e0..735b27244a 100644 --- a/hbase-hadoop2-compat/pom.xml +++ b/hbase-hadoop2-compat/pom.xml @@ -19,10 +19,10 @@ limitations under the License. --> 4.0.0 - hbase + hbase-build-configuration org.apache.hbase 3.0.0-SNAPSHOT - .. + ../hbase-build-configuration hbase-hadoop2-compat diff --git a/hbase-it/pom.xml b/hbase-it/pom.xml index eba444018a..783d9a2ae8 100644 --- a/hbase-it/pom.xml +++ b/hbase-it/pom.xml @@ -21,10 +21,10 @@ --> 4.0.0 - hbase + hbase-build-configuration org.apache.hbase 3.0.0-SNAPSHOT - .. + ../hbase-build-configuration hbase-it diff --git a/hbase-metrics-api/pom.xml b/hbase-metrics-api/pom.xml index 2aa5b0d18a..325e563c31 100644 --- a/hbase-metrics-api/pom.xml +++ b/hbase-metrics-api/pom.xml @@ -21,10 +21,10 @@ --> 4.0.0 - hbase + hbase-build-configuration org.apache.hbase 3.0.0-SNAPSHOT - .. + ../hbase-build-configuration hbase-metrics-api diff --git a/hbase-metrics/pom.xml b/hbase-metrics/pom.xml index 70f0ed01c2..341bb63bd0 100644 --- a/hbase-metrics/pom.xml +++ b/hbase-metrics/pom.xml @@ -21,10 +21,10 @@ --> 4.0.0 - hbase + hbase-build-configuration org.apache.hbase 3.0.0-SNAPSHOT - .. + ../hbase-build-configuration hbase-metrics diff --git a/hbase-prefix-tree/pom.xml b/hbase-prefix-tree/pom.xml index a44a59ed30..c9a4decc33 100644 --- a/hbase-prefix-tree/pom.xml +++ b/hbase-prefix-tree/pom.xml @@ -21,10 +21,10 @@ --> 4.0.0 - hbase + hbase-build-configuration org.apache.hbase 3.0.0-SNAPSHOT - .. + ../hbase-build-configuration hbase-prefix-tree diff --git a/hbase-procedure/pom.xml b/hbase-procedure/pom.xml index 9a68163b13..67f769133e 100644 --- a/hbase-procedure/pom.xml +++ b/hbase-procedure/pom.xml @@ -21,10 +21,10 @@ --> 4.0.0 - hbase + hbase-build-configuration org.apache.hbase 3.0.0-SNAPSHOT - .. + ../hbase-build-configuration hbase-procedure diff --git a/hbase-protocol-shaded/pom.xml b/hbase-protocol-shaded/pom.xml index 4c72ecaa93..d7682b24a9 100644 --- a/hbase-protocol-shaded/pom.xml +++ b/hbase-protocol-shaded/pom.xml @@ -21,10 +21,10 @@ --> 4.0.0 - hbase + hbase-build-configuration org.apache.hbase 3.0.0-SNAPSHOT - .. + ../hbase-build-configuration hbase-protocol-shaded Apache HBase - Shaded Protocol diff --git a/hbase-protocol/pom.xml b/hbase-protocol/pom.xml index 69e1baa3d2..9e5661ad63 100644 --- a/hbase-protocol/pom.xml +++ b/hbase-protocol/pom.xml @@ -21,10 +21,10 @@ --> 4.0.0 - hbase + hbase-build-configuration org.apache.hbase 3.0.0-SNAPSHOT - .. + ../hbase-build-configuration hbase-protocol Apache HBase - Protocol diff --git a/hbase-resource-bundle/pom.xml b/hbase-resource-bundle/pom.xml index 67fe77fb48..07b27d5a92 100644 --- a/hbase-resource-bundle/pom.xml +++ b/hbase-resource-bundle/pom.xml @@ -21,10 +21,10 @@ --> 4.0.0 - hbase + hbase-build-configuration org.apache.hbase 3.0.0-SNAPSHOT - .. + ../hbase-build-configuration hbase-resource-bundle diff --git a/hbase-rest/pom.xml b/hbase-rest/pom.xml index a4f11fff4c..3af9829dc4 100644 --- a/hbase-rest/pom.xml +++ b/hbase-rest/pom.xml @@ -21,10 +21,10 @@ --> 4.0.0 - hbase + hbase-build-configuration org.apache.hbase 3.0.0-SNAPSHOT - .. + ../hbase-build-configuration hbase-rest Apache HBase - Rest diff --git a/hbase-rsgroup/pom.xml b/hbase-rsgroup/pom.xml index bbb489d95a..91f6fc95f6 100644 --- a/hbase-rsgroup/pom.xml +++ b/hbase-rsgroup/pom.xml @@ -21,10 +21,10 @@ --> 4.0.0 - hbase + hbase-build-configuration org.apache.hbase 3.0.0-SNAPSHOT - .. + ../hbase-build-configuration hbase-rsgroup Apache HBase - RSGroup diff --git a/hbase-server/pom.xml b/hbase-server/pom.xml index e377874f64..890ba2b680 100644 --- a/hbase-server/pom.xml +++ b/hbase-server/pom.xml @@ -21,10 +21,10 @@ --> 4.0.0 - hbase + hbase-build-configuration org.apache.hbase 3.0.0-SNAPSHOT - .. + ../hbase-build-configuration hbase-server Apache HBase - Server diff --git a/hbase-shaded/pom.xml b/hbase-shaded/pom.xml index 6bccc7d707..25f3c5905d 100644 --- a/hbase-shaded/pom.xml +++ b/hbase-shaded/pom.xml @@ -21,10 +21,10 @@ --> 4.0.0 - hbase + hbase-build-configuration org.apache.hbase 3.0.0-SNAPSHOT - .. + ../hbase-build-configuration hbase-shaded Apache HBase - Shaded diff --git a/hbase-shell/pom.xml b/hbase-shell/pom.xml index 1928ca8c34..f6127acbd7 100644 --- a/hbase-shell/pom.xml +++ b/hbase-shell/pom.xml @@ -21,10 +21,10 @@ --> 4.0.0 - hbase + hbase-build-configuration org.apache.hbase 3.0.0-SNAPSHOT - .. + ../hbase-build-configuration hbase-shell Apache HBase - Shell diff --git a/hbase-spark-it/pom.xml b/hbase-spark-it/pom.xml index c797395fca..f1f5e440eb 100644 --- a/hbase-spark-it/pom.xml +++ b/hbase-spark-it/pom.xml @@ -21,10 +21,10 @@ --> 4.0.0 - hbase + hbase-build-configuration org.apache.hbase 3.0.0-SNAPSHOT - .. + ../hbase-build-configuration hbase-spark-it diff --git a/hbase-spark/pom.xml b/hbase-spark/pom.xml index d294835189..51e67fa599 100644 --- a/hbase-spark/pom.xml +++ b/hbase-spark/pom.xml @@ -22,10 +22,10 @@ 4.0.0 - hbase + hbase-build-configuration org.apache.hbase 3.0.0-SNAPSHOT - .. + ../hbase-build-configuration hbase-spark Apache HBase - Spark diff --git a/hbase-testing-util/pom.xml b/hbase-testing-util/pom.xml index 9b8733f301..f55ee95c40 100644 --- a/hbase-testing-util/pom.xml +++ b/hbase-testing-util/pom.xml @@ -21,10 +21,10 @@ --> 4.0.0 - hbase + hbase-build-configuration org.apache.hbase 3.0.0-SNAPSHOT - .. + ../hbase-build-configuration hbase-testing-util Apache HBase - Testing Util diff --git a/hbase-thrift/pom.xml b/hbase-thrift/pom.xml index 05cf2618dd..9d7a4b5b03 100644 --- a/hbase-thrift/pom.xml +++ b/hbase-thrift/pom.xml @@ -23,10 +23,10 @@ --> 4.0.0 - hbase + hbase-build-configuration org.apache.hbase 3.0.0-SNAPSHOT - .. + ../hbase-build-configuration hbase-thrift Apache HBase - Thrift diff --git a/pom.xml b/pom.xml index 5040361f30..73799b74a3 100755 --- a/pom.xml +++ b/pom.xml @@ -61,6 +61,8 @@ + hbase-build-support + hbase-build-configuration hbase-resource-bundle hbase-server hbase-thrift @@ -1424,6 +1426,7 @@ 1.4 6.18 1.6.0 + 2.0.21 1.3.9-1 3.0.4 2.4.2 @@ -1441,6 +1444,7 @@ 3.4 3.0.1 1.5.0.Final + 2.8.2 3.2.2 1.0 3.1.0-RC3 @@ -1524,6 +1528,11 @@ test-jar + + org.apache.hbase + hbase-error-prone + ${project.version} + org.apache.hbase hbase-common @@ -3118,33 +3127,6 @@ - - errorProne - - false - - - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven.compiler.version} - - javac-with-errorprone - true - - - - org.codehaus.plexus - plexus-compiler-javac-errorprone - 2.5 - - - - - - -- 2.14.1