[ 
https://issues.apache.org/jira/browse/HBASE-18304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16103391#comment-16103391
 ] 

Tamas Penzes commented on HBASE-18304:
--------------------------------------

Hi,

I've added the RequireUpperBoundDeps enforcer plugin to the project which 
immediately complained about the use of old version of 
com.google.protobuf:protobuf-java.

{code}
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (require-upper-bound-deps) @ 
hbase-procedure ---
[WARNING] Rule 0: org.apache.maven.plugins.enforcer.RequireUpperBoundDeps 
failed with message:
Failed while enforcing RequireUpperBoundDeps. The error(s) are [
Require upper bound dependencies error for 
com.google.protobuf:protobuf-java:2.5.0 paths to dependency are:
+-org.apache.hbase:hbase-procedure:3.0.0-SNAPSHOT
  +-org.apache.hbase:hbase-common:3.0.0-SNAPSHOT
    +-com.google.protobuf:protobuf-java:2.5.0
and
+-org.apache.hbase:hbase-procedure:3.0.0-SNAPSHOT
  +-org.apache.hbase:hbase-protocol-shaded:3.0.0-SNAPSHOT
    +-com.google.protobuf:protobuf-java:2.5.0 (managed) <-- 
com.google.protobuf:protobuf-java:3.2.0
and
+-org.apache.hbase:hbase-procedure:3.0.0-SNAPSHOT
  +-org.apache.hbase:hbase-common:3.0.0-SNAPSHOT
    +-com.google.protobuf:protobuf-java:2.5.0 (managed) <-- 
com.google.protobuf:protobuf-java:3.2.0
and
+-org.apache.hbase:hbase-procedure:3.0.0-SNAPSHOT
  +-org.apache.hadoop:hadoop-common:2.7.1
    +-com.google.protobuf:protobuf-java:2.5.0 (managed) <-- 
com.google.protobuf:protobuf-java:3.2.0
{code}

>From the main pom.xml I've already seen that it won't be simple:
{code}
<!--Internally we use a different version of protobuf. See 
hbase-protocol-shaded-->
<external.protobuf.version>2.5.0</external.protobuf.version>
{code}

Okay, but let's try to update it to 3.2.0 agains the comment, let's see what 
happens (it can show the cause of the comment):

{code}
INFO] --- maven-compiler-plugin:3.6.1:compile (default-compile) @ 
hbase-protocol ---
[INFO] Compiling 31 source files to 
/Users/tamaspenzes/projects/hbase-apache/hbase-protocol/target/classes
[INFO] 
/Users/tamaspenzes/projects/hbase-apache/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/generated/RPCProtos.java:
 Some input files use or override a deprecated API.
[INFO] 
/Users/tamaspenzes/projects/hbase-apache/hbase-protocol/src/main/java/org/apache/hadoop/hbase/protobuf/generated/RPCProtos.java:
 Recompile with -Xlint:deprecation for details.
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] 
/Users/tamaspenzes/projects/hbase-apache/hbase-protocol/src/main/java/com/google/protobuf/HBaseZeroCopyByteString.java:[30,52]
 cannot find symbol
  symbol: class LiteralByteString
[ERROR] 
/Users/tamaspenzes/projects/hbase-apache/hbase-protocol/src/main/java/com/google/protobuf/HBaseZeroCopyByteString.java:[44,16]
 cannot find symbol
  symbol:   class LiteralByteString
  location: class com.google.protobuf.HBaseZeroCopyByteString
[ERROR] 
/Users/tamaspenzes/projects/hbase-apache/hbase-protocol/src/main/java/com/google/protobuf/HBaseZeroCopyByteString.java:[55,16]
 cannot find symbol
  symbol:   class BoundedByteString
  location: class com.google.protobuf.HBaseZeroCopyByteString
[ERROR] 
/Users/tamaspenzes/projects/hbase-apache/hbase-protocol/src/main/java/com/google/protobuf/HBaseZeroCopyByteString.java:[68,24]
 cannot find symbol
  symbol:   class LiteralByteString
  location: class com.google.protobuf.HBaseZeroCopyByteString
[ERROR] 
/Users/tamaspenzes/projects/hbase-apache/hbase-protocol/src/main/java/com/google/protobuf/HBaseZeroCopyByteString.java:[69,16]
 cannot find symbol
  symbol:   class LiteralByteString
  location: class com.google.protobuf.HBaseZeroCopyByteString
[INFO] 5 errors 
{code}

Only five errors, because the build died after the first failed subproject.
These classes (LiteralByteString and BoundedByteString) became private inner 
classes of ByteString recently. (I guess with version 3.0)
But there might be other changes in the API too.

Should I create a separate ticket for updating ProtoBuf which we use all over 
the code?
I could set it as a dependency for this ticket.

Thank, Tamaas

> Start enforcing upperbounds on dependencies
> -------------------------------------------
>
>                 Key: HBASE-18304
>                 URL: https://issues.apache.org/jira/browse/HBASE-18304
>             Project: HBase
>          Issue Type: Task
>          Components: build, dependencies
>    Affects Versions: 2.0.0
>            Reporter: Sean Busbey
>            Assignee: Tamas Penzes
>              Labels: beginner
>             Fix For: 2.0.0
>
>
> would be nice to get this going before our next major version.
> http://maven.apache.org/enforcer/enforcer-rules/requireUpperBoundDeps.html



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to