Skip to content

Installation

This page covers the three things you need before building a component: a per-language toolchain, the ggcommons 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 GGCommons to a project by hand.

GGCommons 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).

The CLI is the Python package ggcommons-cli. It installs two identical console entry points, ggcommons and ggcommons-cli. Templates are bundled into the wheel, so an installed CLI scaffolds offline.

Terminal window
pipx install ./cli # recommended: isolated global `ggcommons`
# or: python3 -m pip install ./cli
# or: python3 -m pip install -e ./cli # editable, for developing the CLI itself

ggcommons doctor checks for the eight tools the CLI can use — git, gdk, cargo, mvn, python3 (or python), node, npm, and aws — and prints [ok] <name> -> <path> or [missing] <name> for each. It reports status only and does not fail when a tool is missing, so a missing entry is only a problem if you need that tool for your language or workflow.

Terminal window
ggcommons doctor

When you scaffold with ggcommons create-component, the dependency is written for you. The --dep-source flag chooses between two forms:

  • local (the default) — a path 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 a registry.

The declarations below show what each form looks like if you are adding GGCommons to an existing project by hand. The current published version is 0.1.0 (the value the CLI substitutes for the <<GGCOMMONS_VERSION>> token).

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

<dependency>
<groupId>com.mbreissi</groupId>
<artifactId>ggcommons</artifactId>
<version>0.1.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/mbreissi/ggcommons</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