Skip to content

Commit 0e6bd7e

Browse files
committed
HADOOP-18487. Protobuf 2.5 removal part 2: stop exporting protobuf-2.5 (#6185)
Followup to the previous HADOOP-18487 patch: changes the scope of protobuf-2.5 in hadoop-common and elsewhere from "compile" to "provided". This means that protobuf-2.5 is * No longer included in hadoop distributions * No longer exported by hadoop common POM files * No longer exported transitively by other hadoop modules. * No longer listed in LICENSE-binary. Contributed by Steve Loughran
1 parent 5a957d9 commit 0e6bd7e

File tree

3 files changed

+17
-12
lines changed

3 files changed

+17
-12
lines changed

BUILDING.txt

+15-9
Original file line numberDiff line numberDiff line change
@@ -301,22 +301,28 @@ Controlling the redistribution of the protobuf-2.5 dependency
301301
the Hadoop codebase; alongside the move to Protobuf 3.x a private successor
302302
class, org.apache.hadoop.ipc.internal.ShadedProtobufHelper is now used.
303303

304-
The hadoop-common JAR still declares a dependency on protobuf-2.5, but this
305-
is likely to change in the future. The maven scope of the dependency can be
306-
set with the common.protobuf2.scope option.
307-
It can be set to "provided" in a build:
308-
-Dcommon.protobuf2.scope=provided
309-
If this is done then protobuf-2.5.0.jar will no longer be exported as a dependency,
310-
and will then be omitted from the share/hadoop/common/lib/ directory of
311-
any Hadoop distribution built. Any application declaring a dependency on hadoop-commmon
312-
will no longer get the dependency; if they need it then they must explicitly declare it:
304+
The hadoop-common module no longer exports its compile-time dependency on
305+
protobuf-2.5. Hadoop distributions no longer include it.
306+
Any application declaring a dependency on hadoop-commmon will no longer get
307+
the artifact added to their classpath.
308+
If is still required, then they must explicitly declare it:
313309

314310
<dependency>
315311
<groupId>com.google.protobuf</groupId>
316312
<artifactId>protobuf-java</artifactId>
317313
<version>2.5.0</version>
318314
</dependency>
319315

316+
In Hadoop builds the scope of the dependency can be set with the
317+
option "common.protobuf2.scope".
318+
This can be upgraded from "provided" to "compile" on the maven command line:
319+
320+
-Dcommon.protobuf2.scope=compile
321+
322+
If this is done then protobuf-2.5.0.jar will again be exported as a
323+
hadoop-common dependency, and included in the share/hadoop/common/lib/
324+
directory of any Hadoop distribution built.
325+
320326
----------------------------------------------------------------------------------
321327
Building components separately
322328

LICENSE-binary

-1
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,6 @@ hadoop-tools/hadoop-sls/src/main/html/js/thirdparty/d3.v3.js
397397
hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/d3-v4.1.1.min.js
398398
leveldb v1.13
399399

400-
com.google.protobuf:protobuf-java:2.5.0
401400
com.google.protobuf:protobuf-java:3.6.1
402401
com.google.protobuf:protobuf-java:3.7.1
403402
com.google.re2j:re2j:1.1

hadoop-project/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@
9090
<!-- This is used in hadoop-common for compilation only -->
9191
<protobuf.version>2.5.0</protobuf.version>
9292
<!-- Protobuf scope in hadoop common -->
93-
<!-- set to "provided" and protobuf2 will no longer be exported as a dependency -->
94-
<common.protobuf2.scope>compile</common.protobuf2.scope>
93+
<!-- set to "provided" so protobuf2 is no longer exported as a dependency -->
94+
<common.protobuf2.scope>provided</common.protobuf2.scope>
9595
<!-- Protobuf scope in other modules which explicitly import the libarary -->
9696
<transient.protobuf2.scope>${common.protobuf2.scope}</transient.protobuf2.scope>
9797
<!-- ProtocolBuffer version, actually used in Hadoop -->

0 commit comments

Comments
 (0)