bazel-contrib / bazel-contrib/rules_jvm_external

Expose maven_export and clean up kotlin/scala merged jars

Open
#855 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
373
Forks
301
Avg merge
6d 3h
Merged PRs (30d)
5

Description

Following up on our Slack discussion, there are a few things to do around exposing `maven_export` so it can be used with Scala:
- expose `maven_export` via `defs.bzl`
- update the jar merge logic to exclude "compiler artifacts" (I don't know what to call this) that get pulled in for Kotlin and Scala because they don't have Maven coordinates:
- For Kotlin:`@com_github_jetbrains_kotlin//:kotlin-stdlib`
- For Scala: `@io_bazel_rules_scala_scala_reflect//:io_bazel_rules_scala_scala_reflect` and `@io_bazel_rules_scala_scala_library//:io_bazel_rules_scala_scala_library` (there may be others, but this was sufficient for my use case)

For anyone encountering the issue of standard library classes making it into the jar: add the appropriate targets to the `deploy_env` parameter.

I'm happy to make a PR or two for these. (My patch to expose `maven_export` in my project is a whopping three line diff, but a PR would need some docs too. The other is bigger, I think.)

Contributor guide

Open the contributing guide

Research direction

Inspect defs.bzl to understand how maven_export is exposed, then locate the jar merge logic and reproduce the Kotlin and Scala cases using the named targets. Verify that the compiler artifacts are excluded, that deploy_env remains the documented workaround for standard-library classes, and add the needed documentation.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, kotlin, scala
Domain
build-system, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.