Skip to content

Latest commit

 

History

History
58 lines (37 loc) · 1.39 KB

File metadata and controls

58 lines (37 loc) · 1.39 KB

Examples

This directory contains copyable examples for using PR Maven CLI as a command-line tool, as a Go library, and inside CI.

CLI Against The Demo Fixture

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 json

No-failure fixture:

go run ./cmd/prmaven fails -project demo/no-failure

CLI Against A Real Maven Project

Generate reports first:

mvn -B verify

Then analyze the workspace:

prmaven why -project .
prmaven why -project . -format json > prmaven-report.json

Remember 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.

Go Library

Run the library example from the repository root:

go run ./examples/library demo/multi-module-failure

It prints a compact summary and each reproduction command returned by pkg/prmaven.

GitHub Actions

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.