Repository: beam Updated Branches: refs/heads/master 49245080a -> ea5b9dabb
[BEAM-2252] Use pluginManagement instead of redefining maven-shade-plugin to inherit build order from root pom.xml Project: http://git-wip-us.apache.org/repos/asf/beam/repo Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/f969ea44 Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/f969ea44 Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/f969ea44 Branch: refs/heads/master Commit: f969ea443c90345cf8c33f953c399e46223e8d03 Parents: 4924508 Author: Luke Cwik <lc...@google.com> Authored: Mon May 15 13:39:12 2017 -0700 Committer: Luke Cwik <lc...@google.com> Committed: Fri May 19 10:36:40 2017 -0700 ---------------------------------------------------------------------- runners/direct-java/pom.xml | 175 ++++++++++++------------ runners/google-cloud-dataflow-java/pom.xml | 121 ++++++++-------- sdks/java/core/pom.xml | 165 +++++++++++----------- sdks/java/io/google-cloud-platform/pom.xml | 33 ++--- 4 files changed, 237 insertions(+), 257 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/beam/blob/f969ea44/runners/direct-java/pom.xml ---------------------------------------------------------------------- diff --git a/runners/direct-java/pom.xml b/runners/direct-java/pom.xml index c581113..857dcf4 100644 --- a/runners/direct-java/pom.xml +++ b/runners/direct-java/pom.xml @@ -40,6 +40,92 @@ </resource> </resources> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-shade-plugin</artifactId> + <executions> + <execution> + <id>bundle-and-repackage</id> + <phase>package</phase> + <goals> + <goal>shade</goal> + </goals> + <configuration> + <shadeTestJar>true</shadeTestJar> + <artifactSet> + <includes> + <include>com.google.guava:guava</include> + <include>com.google.protobuf:protobuf-java</include> + <include>org.apache.beam:beam-runners-core-construction-java</include> + <include>org.apache.beam:beam-runners-core-java</include> + <include>org.apache.beam:beam-sdks-common-runner-api</include> + <include>com.google.code.findbugs:jsr305</include> + </includes> + </artifactSet> + <filters> + <filter> + <artifact>*:*</artifact> + <excludes> + <exclude>META-INF/*.SF</exclude> + <exclude>META-INF/*.DSA</exclude> + <exclude>META-INF/*.RSA</exclude> + </excludes> + </filter> + </filters> + <relocations> + <relocation> + <pattern>org.apache.beam.runners.core</pattern> + <shadedPattern> + org.apache.beam.runners.direct.repackaged.runners.core + </shadedPattern> + </relocation> + <relocation> + <pattern>org.apache.beam.sdk.common</pattern> + <shadedPattern> + org.apache.beam.runners.direct.repackaged.sdk.common + </shadedPattern> + </relocation> + <relocation> + <pattern>com.google.common</pattern> + <excludes> + <!-- com.google.common is too generic, need to exclude guava-testlib --> + <exclude>com.google.common.**.testing.*</exclude> + </excludes> + <shadedPattern> + org.apache.beam.runners.direct.repackaged.com.google.common + </shadedPattern> + </relocation> + <relocation> + <pattern>com.google.protobuf</pattern> + <shadedPattern> + org.apache.beam.runners.direct.repackaged.com.google.protobuf + </shadedPattern> + </relocation> + <relocation> + <pattern>com.google.thirdparty</pattern> + <shadedPattern> + org.apache.beam.runners.direct.repackaged.com.google.thirdparty + </shadedPattern> + </relocation> + <relocation> + <pattern>javax.annotation</pattern> + <shadedPattern> + org.apache.beam.runners.direct.repackaged.javax.annotation + </shadedPattern> + </relocation> + </relocations> + <transformers> + <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/> + </transformers> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </pluginManagement> + <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> @@ -77,95 +163,6 @@ </executions> </plugin> - <!-- Ensure that the Maven jar plugin runs before the Maven - shade plugin by listing the plugin higher within the file. --> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-jar-plugin</artifactId> - </plugin> - - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-shade-plugin</artifactId> - <executions> - <execution> - <id>bundle-and-repackage</id> - <phase>package</phase> - <goals> - <goal>shade</goal> - </goals> - <configuration> - <shadeTestJar>true</shadeTestJar> - <artifactSet> - <includes> - <include>com.google.guava:guava</include> - <include>com.google.protobuf:protobuf-java</include> - <include>org.apache.beam:beam-runners-core-construction-java</include> - <include>org.apache.beam:beam-runners-core-java</include> - <include>org.apache.beam:beam-sdks-common-runner-api</include> - <include>com.google.code.findbugs:jsr305</include> - </includes> - </artifactSet> - <filters> - <filter> - <artifact>*:*</artifact> - <excludes> - <exclude>META-INF/*.SF</exclude> - <exclude>META-INF/*.DSA</exclude> - <exclude>META-INF/*.RSA</exclude> - </excludes> - </filter> - </filters> - <relocations> - <relocation> - <pattern>org.apache.beam.runners.core</pattern> - <shadedPattern> - org.apache.beam.runners.direct.repackaged.runners.core - </shadedPattern> - </relocation> - <relocation> - <pattern>org.apache.beam.sdk.common</pattern> - <shadedPattern> - org.apache.beam.runners.direct.repackaged.sdk.common - </shadedPattern> - </relocation> - <relocation> - <pattern>com.google.common</pattern> - <excludes> - <!-- com.google.common is too generic, need to exclude guava-testlib --> - <exclude>com.google.common.**.testing.*</exclude> - </excludes> - <shadedPattern> - org.apache.beam.runners.direct.repackaged.com.google.common - </shadedPattern> - </relocation> - <relocation> - <pattern>com.google.protobuf</pattern> - <shadedPattern> - org.apache.beam.runners.direct.repackaged.com.google.protobuf - </shadedPattern> - </relocation> - <relocation> - <pattern>com.google.thirdparty</pattern> - <shadedPattern> - org.apache.beam.runners.direct.repackaged.com.google.thirdparty - </shadedPattern> - </relocation> - <relocation> - <pattern>javax.annotation</pattern> - <shadedPattern> - org.apache.beam.runners.direct.repackaged.javax.annotation - </shadedPattern> - </relocation> - </relocations> - <transformers> - <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/> - </transformers> - </configuration> - </execution> - </executions> - </plugin> - <!-- Coverage analysis for unit tests. --> <plugin> <groupId>org.jacoco</groupId> http://git-wip-us.apache.org/repos/asf/beam/blob/f969ea44/runners/google-cloud-dataflow-java/pom.xml ---------------------------------------------------------------------- diff --git a/runners/google-cloud-dataflow-java/pom.xml b/runners/google-cloud-dataflow-java/pom.xml index 9577ceb..c09b7f4 100644 --- a/runners/google-cloud-dataflow-java/pom.xml +++ b/runners/google-cloud-dataflow-java/pom.xml @@ -142,6 +142,63 @@ <skip>true</skip> </configuration> </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-shade-plugin</artifactId> + <executions> + <execution> + <id>bundle-and-repackage</id> + <phase>package</phase> + <goals> + <goal>shade</goal> + </goals> + <configuration> + <shadeTestJar>true</shadeTestJar> + <artifactSet> + <includes> + <include>com.google.guava:guava</include> + <include>org.apache.beam:beam-runners-core-construction-java</include> + </includes> + </artifactSet> + <filters> + <filter> + <artifact>*:*</artifact> + <excludes> + <exclude>META-INF/*.SF</exclude> + <exclude>META-INF/*.DSA</exclude> + <exclude>META-INF/*.RSA</exclude> + </excludes> + </filter> + </filters> + <relocations> + <!-- TODO: Once ready, change the following pattern to 'com' + only, exclude 'org.apache.beam.**', and remove + the second relocation. --> + <relocation> + <pattern>com.google.common</pattern> + <excludes> + <!-- com.google.common is too generic, need to exclude guava-testlib --> + <exclude>com.google.common.**.testing.*</exclude> + </excludes> + <shadedPattern>org.apache.beam.runners.dataflow.repackaged.com.google.common</shadedPattern> + </relocation> + <relocation> + <pattern>com.google.thirdparty</pattern> + <shadedPattern>org.apache.beam.runners.dataflow.repackaged.com.google.thirdparty</shadedPattern> + </relocation> + <relocation> + <pattern>org.apache.beam.runners.core</pattern> + <shadedPattern>org.apache.beam.runners.dataflow.repackaged.org.apache.beam.runners.core</shadedPattern> + </relocation> + </relocations> + <transformers> + <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" /> + </transformers> + </configuration> + </execution> + </executions> + </plugin> </plugins> </pluginManagement> @@ -173,70 +230,6 @@ </executions> </plugin> - <!-- Ensure that the Maven jar plugin runs before the Maven - shade plugin by listing the plugin higher within the file. --> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-jar-plugin</artifactId> - </plugin> - - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-shade-plugin</artifactId> - <executions> - <execution> - <id>bundle-and-repackage</id> - <phase>package</phase> - <goals> - <goal>shade</goal> - </goals> - <configuration> - <shadeTestJar>true</shadeTestJar> - <artifactSet> - <includes> - <include>com.google.guava:guava</include> - <include>org.apache.beam:beam-runners-core-construction-java</include> - </includes> - </artifactSet> - <filters> - <filter> - <artifact>*:*</artifact> - <excludes> - <exclude>META-INF/*.SF</exclude> - <exclude>META-INF/*.DSA</exclude> - <exclude>META-INF/*.RSA</exclude> - </excludes> - </filter> - </filters> - <relocations> - <!-- TODO: Once ready, change the following pattern to 'com' - only, exclude 'org.apache.beam.**', and remove - the second relocation. --> - <relocation> - <pattern>com.google.common</pattern> - <excludes> - <!-- com.google.common is too generic, need to exclude guava-testlib --> - <exclude>com.google.common.**.testing.*</exclude> - </excludes> - <shadedPattern>org.apache.beam.runners.dataflow.repackaged.com.google.common</shadedPattern> - </relocation> - <relocation> - <pattern>com.google.thirdparty</pattern> - <shadedPattern>org.apache.beam.runners.dataflow.repackaged.com.google.thirdparty</shadedPattern> - </relocation> - <relocation> - <pattern>org.apache.beam.runners.core</pattern> - <shadedPattern>org.apache.beam.runners.dataflow.repackaged.org.apache.beam.runners.core</shadedPattern> - </relocation> - </relocations> - <transformers> - <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" /> - </transformers> - </configuration> - </execution> - </executions> - </plugin> - <!-- Coverage analysis for unit tests. --> <plugin> <groupId>org.jacoco</groupId> http://git-wip-us.apache.org/repos/asf/beam/blob/f969ea44/sdks/java/core/pom.xml ---------------------------------------------------------------------- diff --git a/sdks/java/core/pom.xml b/sdks/java/core/pom.xml index 882657b..ea273a2 100644 --- a/sdks/java/core/pom.xml +++ b/sdks/java/core/pom.xml @@ -57,6 +57,85 @@ <testSourceDirectory>${project.basedir}/src/test/</testSourceDirectory> </configuration> </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-shade-plugin</artifactId> + <executions> + <execution> + <id>bundle-and-repackage</id> + <phase>package</phase> + <goals> + <goal>shade</goal> + </goals> + <configuration> + <shadeTestJar>true</shadeTestJar> + <artifactSet> + <includes> + <include>com.google.guava:guava</include> + <include>com.google.protobuf:protobuf-java</include> + <include>net.bytebuddy:byte-buddy</include> + <include>org.apache.commons:*</include> + </includes> + </artifactSet> + <filters> + <filter> + <artifact>*:*</artifact> + <excludes> + <exclude>META-INF/*.SF</exclude> + <exclude>META-INF/*.DSA</exclude> + <exclude>META-INF/*.RSA</exclude> + </excludes> + </filter> + </filters> + <relocations> + <relocation> + <pattern>com.google.common</pattern> + <excludes> + <!-- com.google.common is too generic, need to exclude guava-testlib --> + <exclude>com.google.common.**.testing.*</exclude> + </excludes> + <!--suppress MavenModelInspection --> + <shadedPattern> + org.apache.beam.sdk.repackaged.com.google.common + </shadedPattern> + </relocation> + <relocation> + <pattern>com.google.thirdparty</pattern> + <!--suppress MavenModelInspection --> + <shadedPattern> + org.apache.beam.sdk.repackaged.com.google.thirdparty + </shadedPattern> + </relocation> + <relocation> + <pattern>com.google.protobuf</pattern> + <!--suppress MavenModelInspection --> + <shadedPattern> + org.apache.beam.sdk.repackaged.com.google.protobuf + </shadedPattern> + </relocation> + <relocation> + <pattern>net.bytebuddy</pattern> + <!--suppress MavenModelInspection --> + <shadedPattern> + org.apache.beam.sdk.repackaged.net.bytebuddy + </shadedPattern> + </relocation> + <relocation> + <pattern>org.apache.commons</pattern> + <!--suppress MavenModelInspection --> + <shadedPattern> + org.apache.beam.sdk.repackaged.org.apache.commons + </shadedPattern> + </relocation> + </relocations> + <transformers> + <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" /> + </transformers> + </configuration> + </execution> + </executions> + </plugin> </plugins> </pluginManagement> @@ -120,92 +199,6 @@ </execution> </executions> </plugin> - - <!-- Ensure that the Maven jar plugin runs before the Maven - shade plugin by listing the plugin higher within the file. --> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-jar-plugin</artifactId> - </plugin> - - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-shade-plugin</artifactId> - <executions> - <execution> - <id>bundle-and-repackage</id> - <phase>package</phase> - <goals> - <goal>shade</goal> - </goals> - <configuration> - <shadeTestJar>true</shadeTestJar> - <artifactSet> - <includes> - <include>com.google.guava:guava</include> - <include>com.google.protobuf:protobuf-java</include> - <include>net.bytebuddy:byte-buddy</include> - <include>org.apache.commons:*</include> - </includes> - </artifactSet> - <filters> - <filter> - <artifact>*:*</artifact> - <excludes> - <exclude>META-INF/*.SF</exclude> - <exclude>META-INF/*.DSA</exclude> - <exclude>META-INF/*.RSA</exclude> - </excludes> - </filter> - </filters> - <relocations> - <relocation> - <pattern>com.google.common</pattern> - <excludes> - <!-- com.google.common is too generic, need to exclude guava-testlib --> - <exclude>com.google.common.**.testing.*</exclude> - </excludes> - <!--suppress MavenModelInspection --> - <shadedPattern> - org.apache.beam.sdk.repackaged.com.google.common - </shadedPattern> - </relocation> - <relocation> - <pattern>com.google.thirdparty</pattern> - <!--suppress MavenModelInspection --> - <shadedPattern> - org.apache.beam.sdk.repackaged.com.google.thirdparty - </shadedPattern> - </relocation> - <relocation> - <pattern>com.google.protobuf</pattern> - <!--suppress MavenModelInspection --> - <shadedPattern> - org.apache.beam.sdk.repackaged.com.google.protobuf - </shadedPattern> - </relocation> - <relocation> - <pattern>net.bytebuddy</pattern> - <!--suppress MavenModelInspection --> - <shadedPattern> - org.apache.beam.sdk.repackaged.net.bytebuddy - </shadedPattern> - </relocation> - <relocation> - <pattern>org.apache.commons</pattern> - <!--suppress MavenModelInspection --> - <shadedPattern> - org.apache.beam.sdk.repackaged.org.apache.commons - </shadedPattern> - </relocation> - </relocations> - <transformers> - <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" /> - </transformers> - </configuration> - </execution> - </executions> - </plugin> </plugins> </build> http://git-wip-us.apache.org/repos/asf/beam/blob/f969ea44/sdks/java/io/google-cloud-platform/pom.xml ---------------------------------------------------------------------- diff --git a/sdks/java/io/google-cloud-platform/pom.xml b/sdks/java/io/google-cloud-platform/pom.xml index 7594365..ea2d8f0 100644 --- a/sdks/java/io/google-cloud-platform/pom.xml +++ b/sdks/java/io/google-cloud-platform/pom.xml @@ -32,6 +32,21 @@ <packaging>jar</packaging> <build> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-shade-plugin</artifactId> + <executions> + <execution> + <id>bundle-and-repackage</id> + <phase>none</phase> + </execution> + </executions> + </plugin> + </plugins> + </pluginManagement> + <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> @@ -42,24 +57,6 @@ </systemPropertyVariables> </configuration> </plugin> - - <!-- Ensure that the Maven jar plugin runs before the Maven - shade plugin by listing the plugin higher within the file. --> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-jar-plugin</artifactId> - </plugin> - - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-shade-plugin</artifactId> - <executions> - <execution> - <id>bundle-and-repackage</id> - <phase>none</phase> - </execution> - </executions> - </plugin> </plugins> </build>