| description | Set up a local Java and Maven environment, run javachanges from source, and validate Maven or Gradle target repositories. |
|---|
javachanges is a Java CLI for Maven and Gradle repositories.
This repository is not currently distributed as:
- an
npm installpackage - a
brew installformula - a ready-made global
javachangesexecutable
Instead, the current workflow is:
- install local prerequisites: JDK + Git
- clone the source repository
- compile and run the CLI directly with the Maven Wrapper
Note: the repository includes Maven Wrapper scripts, so most source-repository commands should use
./mvnwinstead of a system Maven.
According to pom.xml, the current project expects:
| Item | Requirement |
|---|---|
| JDK | Java 8+ |
| Maven | Wrapper-provided 3.9.15, or system Maven 3.8+ |
| Git | Required |
| Target repository | Maven root pom.xml, or Gradle gradle.properties plus Gradle settings/build files |
The repository currently develops and validates against Java 8:
| Scenario | Recommendation |
|---|---|
| Day-to-day development | JDK 8 + the repository Maven Wrapper |
| Local default environment | Match the Java 8 compiler target in pom.xml |
| Command execution | Use ./mvnw from the repository root |
Tip: since the repository targets Java 8, using Java 8 locally reduces environment drift.
With Homebrew:
# Install Java 8 (Corretto 8 is recommended)
brew install --cask corretto@8
# Maven is provided by ./mvnw in this repositoryThen verify:
java -version
./mvnw -vIf you want new terminals to default to Java 8:
export JAVA_HOME="/Library/Java/JavaVirtualMachines/amazon-corretto-8.jdk/Contents/Home"
export PATH="$JAVA_HOME/bin:$PATH"Then reopen the terminal or run:
source ~/.zshrcExamples:
# Debian / Ubuntu
sudo apt install openjdk-8-jdk maven
# Fedora
sudo dnf install java-1.8.0-openjdk-devel mavenYou can use:
- JDK: Amazon Corretto 8 / Temurin 8 / Oracle JDK 8
- Maven: official binary, Scoop, or Chocolatey
Verify with:
java -version
./mvnw -vgit clone https://github.com/sonofmagic/javachanges.git
cd javachangesRun:
./mvnw -q testThis mainly does two things:
| Action | Purpose |
|---|---|
| Download dependencies | Prime the local Maven cache |
| Compile the project | Confirm the source builds cleanly |
Note: the repository now includes CLI-focused unit tests, so
./mvnw testvalidates both compilation and command behavior.
Use the repository-local CI helper when you want to check the same broad paths before pushing:
pnpm ci:localFocused tasks are available when you only need one part of the pipeline:
pnpm ci:local:build
pnpm ci:local:docs
pnpm ci:local:releaseThe tasks map to local-safe checks:
| Task | What it validates |
|---|---|
ci:local:build |
Maven verify, the Central publish profile with GPG skipped, and status from source |
ci:local:docs |
pnpm install --frozen-lockfile and the VitePress docs build |
ci:local:release |
GitHub/GitLab release-plan dry-runs, snapshot and release doctor-publish, plus snapshot and release preflight / publish JSON dry-runs |
The release task never passes --execute true. It does not push branches, open PRs/MRs, create tags, create releases, or deploy artifacts. It seeds placeholder Maven release and snapshot repository variables so the local preflight can validate command rendering without requiring real credentials.
The helper pins Maven to .m2/repository inside this checkout, so the local simulation does not depend on a writable global ~/.m2.
./mvnw installThis writes artifacts to ~/.m2/repository, but it does not create a global javachanges command.
This is a CLI project, not a web server. There is no typical:
- hot reload dev server
npm run dev- long-running background process
For this repository, “development mode” usually means:
- edit files under
src/main/java - recompile with Maven
- run the CLI entrypoint through
exec:java, or install the snapshot and use Maven plugin goals - inspect command output and iterate
./mvnw -q -DskipTests compile exec:java -Dexec.args="status --directory /path/to/your/repo"| Segment | Meaning |
|---|---|
compile |
Compile the current source |
exec:java |
Run the main entrypoint directly |
-DskipTests |
Skip tests for faster iteration |
-Dexec.args="..." |
Pass CLI arguments |
If you want to validate the developer-facing plugin UX itself, first install the current snapshot locally:
./mvnw -q -DskipTests installEquivalent repository shortcut:
pnpm snapshot:installThen run the dedicated plugin goals:
mvn io.github.sonofmagic:javachanges:__JAVACHANGES_CURRENT_SNAPSHOT_VERSION__:status
mvn io.github.sonofmagic:javachanges:__JAVACHANGES_CURRENT_SNAPSHOT_VERSION__:plan -Djavachanges.apply=true
mvn io.github.sonofmagic:javachanges:__JAVACHANGES_CURRENT_SNAPSHOT_VERSION__:add -Djavachanges.summary="add release notes command" -Djavachanges.release=minorThe current CLI entry class is:
You can also run or debug this class directly in IntelliJ IDEA or VS Code.
This repository also ships small local shortcuts so you do not need to keep retyping the longer commands:
pnpm snapshot:install
pnpm snapshot:preflight
pnpm snapshot:publish:local
pnpm docs:deploy:localUse them like this:
| Command | Purpose |
|---|---|
pnpm snapshot:install |
Install the current __JAVACHANGES_CURRENT_SNAPSHOT_VERSION__ into the repository-local .m2/repository |
pnpm snapshot:preflight |
Run preflight --snapshot against the current repository with a local build stamp and the repository-local Maven cache |
pnpm snapshot:publish:local |
Publish a unique snapshot revision from this repository through central-publishing-maven-plugin |
pnpm docs:deploy:local |
Rebuild website/dist and serve it locally through Wrangler |
./mvnw -q -DskipTests compile exec:java -Dexec.args="status --directory /path/to/your/repo"./mvnw -q -DskipTests compile exec:java -Dexec.args="add --directory /path/to/your/repo --summary 'add release notes command' --release minor"That command now writes an official Changesets-style file, for example:
```md
---
"your-artifact-id": minor
---
add release notes command
```./mvnw -q -DskipTests compile exec:java -Dexec.args="plan --directory /path/to/your/repo"./mvnw -q -DskipTests compile exec:java -Dexec.args="plan --directory /path/to/your/repo --apply true"./mvnw -q -DskipTests compile exec:java -Dexec.args="help"High-value commands include:
| Command | Purpose |
|---|---|
add |
Create a changeset |
status |
Show pending release state |
plan |
Generate or apply a release plan |
write-settings |
Generate Maven settings |
init-env |
Initialize release env templates |
render-vars |
Render platform variables |
doctor-local |
Check local environment |
doctor-platform |
Check platform variables |
sync-vars |
Sync platform variables |
audit-vars |
Audit platform variables |
preflight |
Run pre-publish checks |
publish |
Assist publishing |
ensure-gpg-public-key |
Publish and verify the current signing public key on supported keyservers |
release-notes |
Generate release notes |
- Install JDK and Git
- Run
./mvnw -q test - Prepare a Maven or Gradle repository for testing
- Edit
src/main/java - Validate behavior with
./mvnw -q -DskipTests compile exec:java -Dexec.args="..." - Run
./mvnw testor./mvnw packagebefore finalizing
| Method | Best for |
|---|---|
./mvnw ... exec:java |
Closest to real CLI usage |
Run JavaChangesCli in an IDE |
Breakpoint debugging |
./mvnw package then verify |
Packaging validation |
Cause: the Maven Wrapper script is not executable after checkout.
Fix:
- run
chmod +x ./mvnw - rerun
./mvnw -v - commit the executable bit if your Git client removed it
Cause: no JDK is installed, or JAVA_HOME / PATH is wrong.
Fix:
- install a JDK
- run
java -version - run
./mvnw -v
The target repository must have at least:
| Requirement | Meaning |
|---|---|
| Git repository | Must be initialized |
| Maven version model | root pom.xml with <revision> |
| Gradle version model | gradle.properties with version or revision |
| Module model | Maven <modules>, Gradle include(...), or a single root artifact/project |
.changesets/ |
Stores changesets |
Because this is a Java CLI project, not a long-running frontend or backend service. The normal flow is to rerun commands after editing:
./mvnw -q -DskipTests compile exec:java -Dexec.args="status --directory /path/to/your/repo"Not from this source repository directly.
Current supported workflows are:
- run from source with
./mvnw ... exec:java - build the jar with Maven and run
java -jar ... - consume a published jar from Maven Central in CI after a release exists
Use this order:
statusplanplan --apply truein a disposable test repositorypreflightpublishwithout--execute true
That lets you inspect the release flow before any real deployment happens.
You can think of this repository as “the source repository of a Java CLI that is run through Maven.”
Shortest path:
| Goal | Command |
|---|---|
| Install local dependencies | brew install --cask corretto@8 |
| Verify environment | java -version && ./mvnw -v |
| Clone the project | git clone https://github.com/sonofmagic/javachanges.git |
| Initial build | ./mvnw -q test |
| Enter development mode | ./mvnw -q -DskipTests compile exec:java -Dexec.args="status --directory /path/to/your/repo" |
| Resource | Link |
|---|---|
| Maven install docs | https://maven.apache.org/install.html |
| Maven run docs | https://maven.apache.org/run.html |
| Amazon Corretto 8 downloads | https://docs.aws.amazon.com/corretto/latest/corretto-8-ug/downloads-list.html |
| Amazon Corretto 8 macOS install | https://docs.aws.amazon.com/corretto/latest/corretto-8-ug/macos-install.html |
| Project overview | README.md |
| Getting started | getting-started.md |
| Troubleshooting | troubleshooting-guide.md |