[
https://issues.apache.org/jira/browse/BEAM-5881?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16669370#comment-16669370
]
Luke Cwik edited comment on BEAM-5881 at 10/30/18 9:43 PM:
-----------------------------------------------------------
This is working as intended since compiling is before shading and hence before
artifact/pom production.
You first compile your code using a dependency such as Guava. Then you can:
* shade: use the shadow plugin to update your code to point to relocated code
and also package the relocated dependency within your jar not exporting it as a
dependency.
* vendor: use the shadow plugin to update your code to point to relocated code
but not package the relocated dependency within your jar and instead point to
an artifact that already contains the relocated code
In general, you can run into this situation if either you don't package the
relocated dependency or declare a vendored dependency. In the case of
BEAM-5875, it looks like you don't include the relocated dependency since guava
isn't part of the compile scope:
https://github.com/apache/beam/blob/f20e90a65874945dbbeb33270cab2a91d619af03/sdks/java/testing/test-utils/build.gradle#L26
was (Author: lcwik):
This is working as intended.
You first compile your code using a dependency such as Guava. Then you can:
* shade: use the shadow plugin to update your code to point to relocated code
and also package the relocated dependency within your jar not exporting it as a
dependency.
* vendor: use the shadow plugin to update your code to point to relocated code
but not package the relocated dependency within your jar and instead point to
an artifact that already contains the relocated code
In general, you can run into this situation if either you don't package the
relocated dependency or declare a vendored dependency. In the case of
BEAM-5875, it looks like you don't include the relocated dependency since guava
isn't part of the compile scope:
https://github.com/apache/beam/blob/f20e90a65874945dbbeb33270cab2a91d619af03/sdks/java/testing/test-utils/build.gradle#L26
> Compile did not fail when Guava dep was left out
> ------------------------------------------------
>
> Key: BEAM-5881
> URL: https://issues.apache.org/jira/browse/BEAM-5881
> Project: Beam
> Issue Type: Bug
> Components: build-system
> Reporter: Kenneth Knowles
> Assignee: Luke Cwik
> Priority: Major
> Fix For: Not applicable
>
>
> In BEAM-5875 a missing dependency allowed compilation but failed at runtime
> because Guava was shaded away. There's obviously some classpath corruption.
> Ideally this would fail to compile.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)