[
https://issues.apache.org/jira/browse/BEAM-8967?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16995860#comment-16995860
]
Tomo Suzuki edited comment on BEAM-8967 at 12/13/19 8:05 PM:
-------------------------------------------------------------
Suspecting around this piece of code in BeamModulePlugin.groovy:
{noformat}
// TODO: Should we use the runtime scope instead of the compile
scope
// which forces all our consumers to declare what they consume?
generateDependenciesFromConfiguration(
configuration: (configuration.shadowClosure ? 'shadow'
: 'compile'), scope: 'compile')
generateDependenciesFromConfiguration(configuration:
'provided', scope: 'provided')
{noformat}
ShadowClosure field of a project?
{code:java}
/**
* If unset, no shading is performed. The jar and test jar archives are
used during publishing.
* Otherwise the shadowJar and shadowTestJar artifacts are used during
publishing.
*
* The shadowJar / shadowTestJar tasks execute the specified closure to
configure themselves.
*/
Closure shadowClosure;
{code}
Found the root cause in the document in [BeamModulePlugin.groovy line
629|https://github.com/apache/beam/blob/master/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy#L629].
JSR305 (which is needed at runtime) should be declared as "shadow", even when
no shading is needed because sdks/java/core uses shadowClosure.
{code:java}
// When the shadowClosure argument is specified, the shadow plugin is
enabled to perform shading
// of commonly found dependencies. Because of this it is important that
dependencies are added
// to the correct configuration. Dependencies should fall into one of these
four configurations:
// * compile - Required during compilation or runtime of the main
source set.
// This configuration represents all dependencies that
much also be shaded away
// otherwise the generated Maven pom will be missing this
dependency.
// * shadow - Required during compilation or runtime of the main
source set.
// Will become a runtime dependency of the generated Maven
pom.
{code}
was (Author: suztomo):
Suspecting around this piece of code in BeamModulePlugin.groovy:
{noformat}
// TODO: Should we use the runtime scope instead of the compile
scope
// which forces all our consumers to declare what they consume?
generateDependenciesFromConfiguration(
configuration: (configuration.shadowClosure ? 'shadow'
: 'compile'), scope: 'compile')
generateDependenciesFromConfiguration(configuration:
'provided', scope: 'provided')
{noformat}
ShadowClosure field of a project?
{noformat}
/**
* If unset, no shading is performed. The jar and test jar archives are
used during publishing.
* Otherwise the shadowJar and shadowTestJar artifacts are used during
publishing.
*
* The shadowJar / shadowTestJar tasks execute the specified closure to
configure themselves.
*/
Closure shadowClosure;
{noformat}
> Maven artifact beam-sdks-java-core does not have dependencies specified as
> "compile"
> ------------------------------------------------------------------------------------
>
> Key: BEAM-8967
> URL: https://issues.apache.org/jira/browse/BEAM-8967
> Project: Beam
> Issue Type: Improvement
> Components: build-system
> Reporter: Tomo Suzuki
> Priority: Major
>
> Maven artifact beam-sdks-java-core does not have dependencies specified as
> "compile".
> This is a followup of [~iemejia]'s finding:
> {quote}
> Just double checked with today's SNAPSHOTs after the merge and the pom of
> core is not modified, however the deps look good in master, not sure if the
> change was applied before the SNAPSHOT generation, but still to double check.
> https://repository.apache.org/content/repositories/snapshots/org/apache/beam/beam-sdks-java-core/2.19.0-SNAPSHOT/beam-sdks-java-core-2.19.0-20191213.072102-9.pom
> {quote}
> in [jsr305 dependency declaration for Nullable
> class|https://github.com/apache/beam/pull/10324#issuecomment-565516004]
--
This message was sent by Atlassian Jira
(v8.3.4#803005)