Skip to content

Don't ship jars in the gem #3018

Description

@headius

JRuby-based gems that depend on other Java JAR files should ideally not ship those jars in the gem, for several reasons:

  • The gem size will be greatly increased.
  • Gems with conflicting copies of the same jars will cause errors if loaded at the same time.
  • Jars should be sourced from the canonical source, Maven.

As part of the WASM work done by Claude in #2998, it appears that all of the related jars are now being shipped in the gem, under lib/rbs/wasm/jars. This adds almost 1MB of size to the released gem.

For this purpose, such gems use jar-dependencies, included with JRuby, to fetch jars from Maven as part of the gem installation. This guarantees that all libraries use the same canonical source (Maven) and do not load conflicting versions (because everyone should go through jar-dependencies which is aware of those versions).

See Psych for an example of a gem that uses jar-dependencies (in that case to fetch the jar for SnakeYAML Engine).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions