Your tests generate raw JSON data in target/allure-results. But JSON files are not a report. You need the Allure CLI to convert those JSON files into a beautiful HTML report. Think of it like this: the test creates the ingredients, the CLI cooks the meal.
# macOS (using Homebrew)
brew install allure
# Windows (using Scoop — recommended)
scoop install allure
# Windows (using Chocolatey)
choco install allure-commandline
# Linux (Debian/Ubuntu)
sudo apt-add-repository ppa:qameta/allure
sudo apt-get update
sudo apt-get install allure
# Linux (manual install — works everywhere)
wget https://github.com/allure-framework/allure2/releases/download/2.25.0/allure-2.25.0.zip
unzip allure-2.25.0.zip
export PATH=$PATH:$(pwd)/allure-2.25.0/bin
# Verify installation
allure --versionThis is a question that confuses beginners. There are two ways to view the report, and you need to know when to use each.
| allure serve | allure generate |
|---|---|
| Starts a temporary local web server | Creates static HTML files on disk |
| Opens report in browser automatically | You open them manually or use allure open |
| Report disappears when you stop the server | Report persists — can be shared/archived |
| Best for local development — quick look | Best for CI/CD — archive as build artifact |
| Usage: allure serve target/allure-results | Usage: allure generate target/allure-results -o report --clean |
# Workflow 1: Quick local check (during development)
mvn test
allure serve target/allure-results
# Browser opens automatically. Press Ctrl+C to stop.
# Workflow 2: Generate persistent report (for sharing)
mvn test
allure generate target/allure-results -o target/allure-report --clean
allure open target/allure-report
# --clean removes old report before generating new one
# Workflow 3: CI/CD pipeline
mvn test
allure generate target/allure-results -o allure-report --clean
# Then archive allure-report/ as a build artifactCommon mistake: running "allure serve target/allure-report" instead of "allure serve target/allure-results". The serve command reads from allure-results (raw JSON), not allure-report (generated HTML). The generate command creates allure-report from allure-results.
Q: What is the difference between allure serve and allure generate?
A: "allure serve" creates a temporary report and opens it in a browser via a local web server — best for quick local checks during development. "allure generate" creates static HTML files that persist on disk and can be shared or archived — best for CI/CD pipelines. Both read from allure-results directory containing JSON data, but serve is transient while generate creates permanent output.
Key Point: Use "allure serve" for quick local viewing, "allure generate" for persistent reports and CI/CD.