dennismdejong opened a new pull request, #13712:
URL: https://github.com/apache/gravitino/pull/13712
### What changes were proposed in this pull request?
Shaded runtime artifacts declared the modules and third-party libraries they
pack into the jar
as `implementation` dependencies. Gradle maps `implementation` to `runtime`
scope in the published
POM and lists the same dependencies in the `runtimeElements` variant of the
Gradle module metadata,
so resolving the coordinate downloaded unshaded copies of the classes the
jar already contains.
`--packages` copied 31 artifacts (46 MB) for the Spark 3.5 connector where
one is expected.
The bundled inputs are now declared on a private `shadedDependencies`
configuration that only feeds
`shadowJar`, so the published POM and the Gradle module metadata declare no
dependencies while the
packaged content is unchanged.
Affected artifacts (all with the same cause):
- `gravitino-spark-connector-runtime-3.5_2.12`,
`gravitino-spark-connector-runtime-4.0_2.13`
- `gravitino-flink-connector-runtime-1.19_2.12`, `-1.20_2.12`, `-2.1`
- `gravitino-client-java-runtime`, `gravitino-filesystem-hadoop3-runtime`
The last two are outside the issue title but share the cause (reported in
the issue discussion), so
they are fixed here as well; say the word if you would rather keep this PR
to the connector runtimes.
`client-java-runtime`'s `TestRuntimeJarLegalFiles` read
`configurations.runtimeClasspath` to build
the `dependencyJars` system property; it now reads `shadedDependencies`
(same content, since
`shadowJar` packages that configuration).
### Does this PR introduce any user-facing change?
Yes. The published POMs and Gradle module metadata of the artifacts above no
longer declare the
dependencies that are already packaged into the jar, so resolving the
coordinate yields the runtime
jar alone. The jar content is unchanged.
### How was this patch tested?
- Generated POM/metadata for all seven artifacts: dependency count goes
`3/3/2/2/3/1/8` → `0`, and
no variant of the module metadata lists dependencies any more.
- `publishToMavenLocal` for all seven: POM dependencies `0`, the shaded jar
is still the
classifier-less main artifact.
- Jar entry lists before/after are identical for all seven artifacts
(`13483 / 13467 / 10610 / 10610 / 10636 / 8073 / 12761` entries), so the
packaged content did not
change.
- Resolution check: a consumer resolving
`org.apache.gravitino:gravitino-spark-connector-runtime-3.5_2.12`
now resolves one artifact; before the fix it also pulled
`gravitino-client-java-runtime`,
`gravitino-spark-3.5_2.12` and their transitive trees.
- New `verifyShadedRuntimePom` verification task (wired into `check` for
modules that declare the
`shadedDependencies` configuration) fails on a re-introduced dependency:
`:spark-connector:spark-runtime-3.5 publishes dependencies its jar already
contains: org.apache.gravitino:gravitino-api`.
- `:flink-connector:flink-runtime-1.19:test`, `-1.20:test`, `-2.1:test` and
`:clients:client-java-runtime:test` pass; `spotlessKotlinGradleCheck`
passes for all touched
scripts.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]