From 65822d3c7d584238e4d41334c2eac4292ca7120b 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 | 2 + 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 | 71 ++++++++++++++++ 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, 340 insertions(+), 81 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 1699ea0f0b..5ac6beff66 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..d3d5e0c067 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 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..e75ce86a4d --- /dev/null +++ b/hbase-build-support/pom.xml @@ -0,0 +1,71 @@ + + + + 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 + + + + + diff --git a/hbase-client/pom.xml b/hbase-client/pom.xml index cc1143d6d8..3e4d9b12da 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 ae0f6923cb..1075d25a39 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 c45e953028..66354815f6 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 diff --git a/hbase-examples/pom.xml b/hbase-examples/pom.xml index 3a30add33e..48ac6eb70a 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 e750653538..d09bc0d1e5 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 98993369e9..41db86feeb 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 e52db17f9e..01022c6790 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 ae8c790569..ded47b4022 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 1205082bcd..7a8a9f98a4 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 6ff8e3a824..11d179d8dc 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 a13584a2ef..2d6ed96e89 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 2fa01a17e6..e6a34f3340 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 d5953b660c..3c2683d4c4 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 f3296ac091..2640a3ccb3 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 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 5b4d209b9f..f115ae3df2 100644 --- a/hbase-rest/pom.xml +++ b/hbase-rest/pom.xml @@ -23,10 +23,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 486a573809..20bf0575e3 100644 --- a/hbase-rsgroup/pom.xml +++ b/hbase-rsgroup/pom.xml @@ -22,10 +22,10 @@ --> 4.0.0 - hbase + hbase-build-configuration org.apache.hbase 3.0.0-SNAPSHOT - .. + ../hbase-build-configuration hbase-rsgroup diff --git a/hbase-server/pom.xml b/hbase-server/pom.xml index fb0a1ca133..43bd85460e 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 3f9a317606..888f66c49b 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 cfe0312bdd..8e34ec1b0d 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 94ed27f230..3d2c1b1673 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 c4366c1f32..8067633fcf 100644 --- a/hbase-spark/pom.xml +++ b/hbase-spark/pom.xml @@ -28,10 +28,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 66417aad94..5d04c6ea7a 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 814801ca58..3a985372e4 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 329c4685be..7b2374d694 100644 --- a/pom.xml +++ b/pom.xml @@ -61,6 +61,8 @@ + hbase-build-support + hbase-build-configuration hbase-resource-bundle hbase-server hbase-thrift @@ -1397,6 +1399,7 @@ 1.4 6.18 1.6.0 + 2.0.21 1.3.9-1 3.0.4 2.4.2 @@ -1414,6 +1417,7 @@ 3.4 3.0.1 1.5.0.Final + 2.8.2 3.2.2 1.0 3.1.0-RC3 @@ -1498,6 +1502,11 @@ org.apache.hbase + hbase-error-prone + ${project.version} + + + org.apache.hbase hbase-common ${project.version} @@ -3085,33 +3094,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.13.0