This directory contains copyable examples for using PR Maven CLI as a command-line tool, as a Go library, and inside CI.
From the repository root:
go run ./cmd/prmaven fails -project demo/multi-module-failure
go run ./cmd/prmaven why -project demo/multi-module-failure -format jsonNo-failure fixture:
go run ./cmd/prmaven fails -project demo/no-failureGenerate reports first:
mvn -B verifyThen analyze the workspace:
prmaven why -project .
prmaven why -project . -format json > prmaven-report.jsonRemember that prmaven exits with code 1 when findings exist. In CI, preserve the Maven exit code when Maven is the source of truth for pass/fail status.
Run the library example from the repository root:
go run ./examples/library demo/multi-module-failureIt prints a compact summary and each reproduction command returned by pkg/prmaven.
The workflow example at github-actions/triage-maven-failures.yml shows how to:
- run Maven;
- install PR Maven CLI;
- print text output;
- upload JSON output as an artifact;
- preserve the original Maven failure status.
GitHub Actions is the only first-party CI platform example today. The CLI itself does not call the GitHub API in Stage 1.