Skip to content

Installation

This page covers the three things you need before building a component: a per-language toolchain, the edgecommons scaffolding CLI, and the library dependency wired into your project. The CLI normally wires the dependency for you when it scaffolds a component — the manual declarations below are for adding EdgeCommons to a project by hand.

EdgeCommons is one SDK in four languages. You only need the toolchain for the language you build in.

Java 25 (LTS) and Maven. The published SDK artifact is built for Java 25, so a JDK 25 is required even though a generated component compiles its own bytecode to level 11.

Terminal window
java -version # expect 25.x
mvn -version # any recent Maven 3.x

Beyond the language toolchain, you will want git, a local MQTT broker for HOST-platform testing, and — for packaging/deploying to Greengrass — the GDK (Greengrass Development Kit).

edgecommons is a single static binary. Build and install it from the cli/ workspace of the monorepo:

Terminal window
cargo install --path cli/crates/ec-cli # installs `edgecommons` onto your PATH

Building the CLI needs a rustup toolchain; running it needs nothing else. The component templates and the canonical config schema live inside the binary, so the CLI scaffolds and validates offline. Scaffolding a Java or TypeScript component needs nothing but the binary — the language toolchain is what builds the result, not what generates it.

edgecommons doctor checks the external tools the platforms you target need, reports the version of each, and exits non-zero when a required tool is missing. Narrow it with --platforms and -l/--language so it only checks what your workflow actually uses.

Terminal window
edgecommons doctor # everything, for all three platforms
edgecommons doctor --platforms HOST -l RUST # just what a Rust component on HOST needs

When you scaffold with edgecommons component new, the dependency is written for you. The --dep-source flag chooses between three forms:

  • local (the default) — a path/file dependency on a monorepo checkout of the library. Best for developing against the SDK in this repo, and it needs no registry access.
  • registry — the published artifact, resolved from GitHub Packages or a git tag.
  • pinned-rev (Rust and Python only) — a git dependency pinned to the exact library commit the CLI was built from (--library-rev overrides it), plus a gitignored .cargo/config.toml local-dev override for Rust. This is the recommended choice once a component leaves the monorepo as its own repository: the pin cannot lag the facades the embedded templates call the way a registry tag can. Maven and npm cannot express a git dependency on a subdirectory of the monorepo, so Java and TypeScript reject it.

The declarations below show what each form looks like if you are adding EdgeCommons to an existing project by hand. edgecommons component new substitutes the library version the CLI was built against.

Coordinate com.mbreissi.edgecommons:edgecommons. Add the dependency to your pom.xml:

<dependency>
<groupId>com.mbreissi.edgecommons</groupId>
<artifactId>edgecommons</artifactId>
<version>0.2.0</version>
</dependency>

Registry — resolve from GitHub Packages by adding the repository and authenticating in ~/.m2/settings.xml with a <server> whose <id> is github and a GitHub token that has the read:packages scope:

<repositories>
<repository>
<id>github</id>
<url>https://maven.pkg.github.com/edgecommons/edgecommons</url>
</repository>
</repositories>

Local — build the library from the monorepo and install it to your local Maven cache, then the same coordinate resolves from ~/.m2 with no repository configured:

Terminal window
cd libs/java && mvn clean install