From 86be78b2bfa526b2394b4314c31d59357141191a Mon Sep 17 00:00:00 2001 From: Mike Drob Date: Wed, 11 Apr 2018 21:25:04 -0500 Subject: [PATCH] HBASE-20356 Make skipping protoc possible --- dev-support/hbase-personality.sh | 2 +- hbase-protocol-shaded/pom.xml | 5 ++++- hbase-protocol/pom.xml | 5 ++++- src/main/asciidoc/_chapters/developer.adoc | 15 +++++++++------ 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/dev-support/hbase-personality.sh b/dev-support/hbase-personality.sh index 90786f2910..3507a1d8de 100755 --- a/dev-support/hbase-personality.sh +++ b/dev-support/hbase-personality.sh @@ -554,7 +554,7 @@ function hbaseprotoc_rebuild # Need to run 'install' instead of 'compile' because shading plugin # is hooked-up to 'install'; else hbase-protocol-shaded is left with # half of its process done. - modules_workers patch hbaseprotoc install -DskipTests -Pcompile-protobuf -X -DHBasePatchProcess + modules_workers patch hbaseprotoc install -DskipTests -X -DHBasePatchProcess # shellcheck disable=SC2153 until [[ $i -eq "${#MODULE[@]}" ]]; do diff --git a/hbase-protocol-shaded/pom.xml b/hbase-protocol-shaded/pom.xml index 021e424843..25443e1830 100644 --- a/hbase-protocol-shaded/pom.xml +++ b/hbase-protocol-shaded/pom.xml @@ -106,7 +106,7 @@ 1.5.3 - generate-sources + process-sources replace @@ -117,6 +117,9 @@ **/*.java + + true ([^\.])com.google.protobuf diff --git a/hbase-protocol/pom.xml b/hbase-protocol/pom.xml index e6d546e6e3..bfe2588712 100644 --- a/hbase-protocol/pom.xml +++ b/hbase-protocol/pom.xml @@ -81,7 +81,7 @@ 1.5.3 - generate-sources + process-sources replace @@ -92,6 +92,9 @@ **/*.java + + true (public)(\W+static)?(\W+final)?(\W+class) diff --git a/src/main/asciidoc/_chapters/developer.adoc b/src/main/asciidoc/_chapters/developer.adoc index a6e9c3ebed..8c22013ee1 100644 --- a/src/main/asciidoc/_chapters/developer.adoc +++ b/src/main/asciidoc/_chapters/developer.adoc @@ -415,22 +415,25 @@ use so we can freely change versions without upsetting any downstream project us The protobuf files are located in _hbase-protocol/src/main/protobuf_. For the change to be effective, you will need to regenerate the classes. -You can use maven profile `compile-protobuf` to do this. [source,bourne] ---- -mvn compile -Pcompile-protobuf +mvn package -pl hbase-protocol -am ---- -You may also want to define `protoc.path` for the protoc binary, using the following command: +Similarly, protobuf definitions for internal use are located in the _hbase-protocol-shaded_ module. [source,bourne] ---- - -mvn compile -Pcompile-protobuf -Dprotoc.path=/opt/local/bin/protoc +mvn package -pl hbase-protocol-shaded -am ---- -Read the _hbase-protocol/README.txt_ for more details. +Typically, protobuf code generation is done using the native `protoc` binary. In our build we use a maven plugin for +convenience; however, precompiled binaries do not exist for all platforms. If you find yourself a platform where protoc +fails, you will have to compile protoc from source, and run it independent of our maven build. You can disable the +inline code generation by specifying `-Dprotoc.skip` in your maven arguments, allowing your build to proceed further. + +Read the _hbase-protocol/README.txt_ for more details [[build.thrift]] ==== Build Thrift -- 2.16.1