Adjust dependencies to avoid pulling in unneeded stax-api

This is the javax.xml.stream API that is provided with Java 1.6 and
up.

 - The dependency on stax-api from stax2-api switched from "compile"
   scope to "provided" scope in current versions, so we can remove
   the transitive dependency simply by upgrade.
 - The woodstox-core-asl package is upgraded to a version explicitly
   compatible with the new version of stax2-api.
 - The dependency on stax-api from woodstox-core-asl remains in "compile"
   scope even after upgrade, so this change explicitly suppresses it.

Selected bits of `mvn dependency:tree -Dverbose`:

 [INFO] com.google.cloud.dataflow:google-cloud-dataflow-java-sdk-all:jar:1...)
-[INFO] +- org.codehaus.woodstox:stax2-api:jar:3.1.1:compile
-[INFO] |  \- javax.xml.stream:stax-api:jar:1.0-2:compile
-[INFO] +- org.codehaus.woodstox:woodstox-core-asl:jar:4.1.2:compile
-[INFO] |  +- (javax.xml.stream:stax-api:jar:1.0-2:compile - omitted for d...)
-[INFO] |  \- (org.codehaus.woodstox:stax2-api:jar:3.1.1:compile - omitted...)
+[INFO] +- org.codehaus.woodstox:stax2-api:jar:3.1.4:compile
+[INFO] +- org.codehaus.woodstox:woodstox-core-asl:jar:4.4.1:compile
+[INFO] |  \- (org.codehaus.woodstox:stax2-api:jar:3.1.4:compile - omitted...)

----Release Notes----

[]
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=115574469


Project: http://git-wip-us.apache.org/repos/asf/incubator-beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-beam/commit/6c710405
Tree: http://git-wip-us.apache.org/repos/asf/incubator-beam/tree/6c710405
Diff: http://git-wip-us.apache.org/repos/asf/incubator-beam/diff/6c710405

Branch: refs/heads/master
Commit: 6c710405af5fef7e8a6b334a7e393dc5d8ab006e
Parents: 510a55d
Author: klk <[email protected]>
Authored: Thu Feb 25 10:07:00 2016 -0800
Committer: Davor Bonaci <[email protected]>
Committed: Thu Feb 25 23:58:28 2016 -0800

----------------------------------------------------------------------
 pom.xml     |  2 ++
 sdk/pom.xml | 11 +++++++++--
 2 files changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/6c710405/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 760a10d..bfade1a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -82,7 +82,9 @@
     <protobuf.version>3.0.0-beta-1</protobuf.version>
     <pubsub.version>v1-rev7-1.21.0</pubsub.version>
     <slf4j.version>1.7.14</slf4j.version>
+    <stax2.version>3.1.4</stax2.version>
     <storage.version>v1-rev53-1.21.0</storage.version>
+    <woodstox.version>4.4.1</woodstox.version>
   </properties>
 
   <packaging>pom</packaging>

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/6c710405/sdk/pom.xml
----------------------------------------------------------------------
diff --git a/sdk/pom.xml b/sdk/pom.xml
index aeead72..1f15b02 100644
--- a/sdk/pom.xml
+++ b/sdk/pom.xml
@@ -667,15 +667,22 @@
     <dependency>
       <groupId>org.codehaus.woodstox</groupId>
       <artifactId>stax2-api</artifactId>
-      <version>3.1.1</version>
+      <version>${stax2.version}</version>
       <optional>true</optional>
     </dependency>
 
     <dependency>
       <groupId>org.codehaus.woodstox</groupId>
       <artifactId>woodstox-core-asl</artifactId>
-      <version>4.1.2</version>
+      <version>${woodstox.version}</version>
       <optional>true</optional>
+      <exclusions>
+        <!-- javax.xml.stream:stax-api is included in JDK 1.6+ -->
+        <exclusion>
+          <groupId>javax.xml.stream</groupId>
+          <artifactId>stax-api</artifactId>
+        </exclusion>
+      </exclusions>
     </dependency>
 
     <!--

Reply via email to