[
https://issues.apache.org/jira/browse/BEAM-2242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16005326#comment-16005326
]
ASF GitHub Bot commented on BEAM-2242:
--------------------------------------
GitHub user lukecwik opened a pull request:
https://github.com/apache/beam/pull/3061
Cherry-pick #3034: [BEAM-2242] Ensure that jars are shaded correctly by
running the jar plugin before the shade plugin
Be sure to do all of the following to help us incorporate your contribution
quickly and easily:
- [ ] Make sure the PR title is formatted like:
`[BEAM-<Jira issue #>] Description of pull request`
- [ ] Make sure tests pass via `mvn clean verify`.
- [ ] Replace `<Jira issue #>` in the title with the actual Jira issue
number, if there is one.
- [ ] If this contribution is large, please file an Apache
[Individual Contributor License
Agreement](https://www.apache.org/licenses/icla.pdf).
---
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/lukecwik/incubator-beam beam2242
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/beam/pull/3061.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #3061
----
commit 4324d9d99bd3444ca0f9fbde48b13ca214b7c318
Author: Luke Cwik <[email protected]>
Date: 2017-05-10T02:07:36Z
[BEAM-2242] Ensure that jars are shaded correctly by running the jar plugin
before the shade plugin
This required listing the maven jar plugin earlier within the file so that
the jar/test jar ran before shade within the package phase.
I also update the maven shade plugin version in archetypes to pickup the
fixes in the service file transformer and dropped the usage of finalName in the
shade plugin so all artifacts are named the same way.
----
> Apache Beam Java modules do not correctly shade test artifacts
> --------------------------------------------------------------
>
> Key: BEAM-2242
> URL: https://issues.apache.org/jira/browse/BEAM-2242
> Project: Beam
> Issue Type: Bug
> Components: sdk-java-core
> Reporter: Luke Cwik
> Assignee: Luke Cwik
> Priority: Blocker
> Fix For: 2.0.0
>
>
> javap dump of TextIOTest.class
> Not the unshaded references to org.apache.commons.compress.*
> {code}
> Compiled from "TextIOTest.java"
> public class org.apache.beam.sdk.io.TextIOTest {
> ...
> private static java.io.File writeToFile(java.lang.String[],
> java.lang.String, org.apache.beam.sdk.io.TextIO$CompressionType) throws
> java.io.IOException;
> descriptor:
> ([Ljava/lang/String;Ljava/lang/String;Lorg/apache/beam/sdk/io/TextIO$CompressionType;)Ljava/io/File;
> Code:
> 0: getstatic #6 // Field
> tempFolder:Ljava/nio/file/Path;
> 3: aload_1
> 4: invokeinterface #7, 2 // InterfaceMethod
> java/nio/file/Path.resolve:(Ljava/lang/String;)Ljava/nio/file/Path;
> 9: invokeinterface #8, 1 // InterfaceMethod
> java/nio/file/Path.toFile:()Ljava/io/File;
> 14: astore_3
> 15: new #9 // class java/io/FileOutputStream
> 18: dup
> 19: aload_3
> 20: invokespecial #10 // Method
> java/io/FileOutputStream."<init>":(Ljava/io/File;)V
> 23: astore 4
> 25: getstatic #11 // Field
> org/apache/beam/sdk/io/TextIOTest$4.$SwitchMap$org$apache$beam$sdk$io$TextIO$CompressionType:[I
> 28: aload_2
> 29: invokevirtual #12 // Method
> org/apache/beam/sdk/io/TextIO$CompressionType.ordinal:()I
> 32: iaload
> 33: tableswitch { // 1 to 5
> 1: 68
> 2: 71
> 3: 85
> 4: 99
> 5: 131
> default: 145
> }
> 68: goto 157
> 71: new #13 // class
> java/util/zip/GZIPOutputStream
> 74: dup
> 75: aload 4
> 77: invokespecial #14 // Method
> java/util/zip/GZIPOutputStream."<init>":(Ljava/io/OutputStream;)V
> 80: astore 4
> 82: goto 157
> 85: new #15 // class
> org/apache/commons/compress/compressors/bzip2/BZip2CompressorOutputStream
> 88: dup
> 89: aload 4
> 91: invokespecial #16 // Method
> org/apache/commons/compress/compressors/bzip2/BZip2CompressorOutputStream."<init>":(Ljava/io/OutputStream;)V
> 94: astore 4
> 96: goto 157
> 99: new #17 // class
> java/util/zip/ZipOutputStream
> 102: dup
> 103: aload 4
> 105: invokespecial #18 // Method
> java/util/zip/ZipOutputStream."<init>":(Ljava/io/OutputStream;)V
> 108: astore 5
> 110: aload 5
> 112: new #19 // class java/util/zip/ZipEntry
> 115: dup
> 116: ldc #20 // String entry
> 118: invokespecial #21 // Method
> java/util/zip/ZipEntry."<init>":(Ljava/lang/String;)V
> 121: invokevirtual #22 // Method
> java/util/zip/ZipOutputStream.putNextEntry:(Ljava/util/zip/ZipEntry;)V
> 124: aload 5
> 126: astore 4
> 128: goto 157
> 131: new #23 // class
> org/apache/commons/compress/compressors/deflate/DeflateCompressorOutputStream
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)