Thanks for helping improve contentful.java.
This repository includes a .devcontainer configuration for a reproducible local setup. GitHub Actions uses the same devcontainer configuration for CI.
Open the repository in Visual Studio Code, install the Dev Containers extension if needed, then run Dev Containers: Reopen in Container. Wait for the container build and post-create setup to finish.
Install Docker and the Dev Container CLI (npm install -g @devcontainers/cli). From the repository root, run:
devcontainer up --workspace-folder .
devcontainer exec --workspace-folder . bash./mvnw -B test- Fork the repository and create a branch for your change.
- Run the relevant checks from the dev container.
- Open a pull request with a short summary of the change and any follow-up context.
- Framework: JUnit 4
- Location:
src/test/java/com/contentful/java/cda/(unit + mock-server tests);src/test/java/com/contentful/java/cda/integration/(integration tests against live environments) - Fixtures:
src/test/resources/— canned JSON responses used by mock-server tests - Run all (unit):
./mvnw -B test- Integration tests connect to live Contentful spaces using hardcoded read-only credentials (space IDs and tokens are baked into the test classes under
src/test/java/…/cda/integration/). No environment variables are required. Integration tests are included in the./mvnw -B testrun and therefore execute in CI.
Conventional Commits are preferred:
type: description
Common types: feat, fix, chore, docs, refactor, test, ci
Examples:
feat: add cross-space reference resolution support
fix: strip extensions from locale identifiers
chore: update okhttp to 5.1.0
master— trunk branch; all development targets master directly or via short-lived feature branches- Feature branches —
feat/<description>,fix/<description> - Release branches are not used; releases are cut directly from master
Releases are on-demand and require the Contentful GPG key imported locally (obtain from your team lead):
# 1. Ensure all tests pass on master
./mvnw -B test
# 2. Add -SNAPSHOT postfix to <version> in pom.xml if not already present
# 3. Prepare the release (prompts for release version and next snapshot version)
./mvnw release:prepare
# 4. Perform the release (builds, signs, and publishes to Maven Central)
./mvnw release:performArtifacts are published to Maven Central under com.contentful.java:java-sdk. Pre-releases are available via Sonatype snapshots and jitpack.io.
| Job | Trigger | What it does |
|---|---|---|
Test (Java 8) |
Push or PR to master |
Spins up devcontainer, runs ./mvnw -B test |
CI runs inside the same devcontainer used for local development (eclipse-temurin:8-jdk-jammy), ensuring environment parity. The JAVA_VERSION build arg defaults to 8 and can be overridden.