Skip to content

[3.0] Publish a batteries-included artifact so jbang users get the default extensions #901

Description

@jbachorik

Problem

The two primary install paths ship different capabilities:

Install path What you get
jbang io.btrace:btrace (Maven Central) engine only — no extensions
Distribution (SDKMAN / tar-zip / $BTRACE_HOME) engine + bundled default extensions in extensions/
Custom fat agent (fatAgentJar -PembedExtensions=… / Maven fat-agent goal) engine + chosen extensions, embedded

Root cause: the published io.btrace:btrace masked JAR depends only on btrace-agent/btrace-client/btrace-compiler (btrace-dist/build.gradle:115-117), so it contains zero extension implementations and sets no BTrace-Embedded-Extensions manifest entry. Under jbang, BTRACE_HOME resolves to the ~/.m2/.../btrace-<version>.jar location, which has no sibling extensions/ dir — so both discovery paths (filesystem scan of $BTRACE_HOME/extensions/ and embedded-from-resources) come up empty (Main.java:418,426). Users get core tracing (probes, BTraceUtils, aggregations, profiling, JFR) but none of metrics/statsd/contracts/llm-trace/etc.

Decision

Publish a second, batteries-included artifact that embeds the default extensions, while keeping the lean io.btrace:btrace for users who want just the engine.

  • Lean: jbang io.btrace:btrace → engine only (unchanged).
  • Batteries-included: jbang io.btrace:btrace-all → engine + default extensions embedded. (artifact name btrace-all is a suggestion — confirm before implementing.)

Work

  • Add a btrace-all publication to btrace-dist that produces the fat agent with the default (allow-listed) extensions embedded — reuse the existing btraceFatAgent/fatAgentJar mechanism (build.gradle:459+) with autoDiscover limited to the default set.
  • Publish + sign the new artifact in release.yml alongside io.btrace:btrace (currently only :btrace-dist:publishAllPublicationsToSonatypeRepository → the single btrace artifact).
  • Update jbang docs/aliases: document both the lean and batteries-included one-liners and what each includes.
  • Add a smoke test that a script using a default extension (e.g. metrics) links successfully when run from the batteries-included artifact and fails cleanly (with a clear message) from the lean one.

Depends on / relates to

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions