How ca1pher/allure2 works
Project type and purpose
• This is Allure Report—a command-line tool and static report generator for test results.
• It comprises multiple Java modules (CLI, generator core, plugin API, plugins, Jira commons) and a JavaScript frontend (webpack-built) to render interactive HTML reports.
File structure
• Top-level modules (Gradle subprojects):
• allure-commandline: CLI entrypoint (Java)
• allure-generator: report-generation engine (Java + JS frontend + templates + webpack)
• allure-plugin-api: core plugin interface (Java)
• allure-jira-commons: shared Jira integration (Java)
• plugins/*: individual result readers/exporters (Java or JS)
• Configuration and build files: Gradle wrappers, build scripts, Jenkinsfile.
• Frontend under allure-generator/src/main/javascript, built via webpack.
• Templates: Freemarker (.ftl) in resources/tpl.
• Static layouts and plugin API exports for dynamic widgets in JS.
README
• Confirms project purpose: “flexible lightweight multi-language test report tool” with commands generate, serve, open.
• Mentions multi-language support and plugin ecosystem.
a. Main components
• CLI (CommandLine.java)
• Core engine (ReportGenerator, ConfigurationBuilder)
• Plugin infrastructure
– Plugin API (interfaces: Plugin, Aggregator, Reader, Widget)
– Built-in plugins (cucumber-json, junit-xml, xunit, trx, behaviours, etc.)
– Third-party plugins via ServiceLoader
• Data sources (Allure results folder: JSON, XML, attachments)
• Template engine (Freemarker)
• JavaScript frontend (Webpack bundle)
• Local web server (Jetty) for “serve” command
• Browser client
b. Relationships and interactions
1. User invokes CLI →
• Parses CLI args (GenerateCommand/OpenCommand/ServeCommand)
• Loads configuration (CommandlineConfig, ConfigLoader)
2. GenerateCommand →
• Reads test result files via plugins (Reader implementations)
• Feeds data into core engine → ReportGenerator
• ReportGenerator calls plugins (Aggregator, Writer, Widget) to produce JSON and static assets
• Freemarker templates + JS/CSS/HTML write to “allure-report” directory
3. ServeCommand →
• Starts embedded Jetty server
• Serves generated static content (HTML, JS, CSS, data)
4. OpenCommand →
• Launches default browser pointing to local/remote report URL
5. Frontend →
• Loads JS bundle (Webpack output)
• Fetches JSON data files
• Renders interactive UI (charts, trees, widgets)
c. Architectural patterns and design principles
• Modular micro-kernel: Core engine + plugin extensions via Plugin API
• Clear separation: CLI, core generation, plugin interface, frontend
• Build pipelines: Gradle for Java modules, Webpack for JS
• ServiceLoader/dynamic loading of plugins (Java SPI)
• Template-based static site generation (Freemarker + JS templates)
d. Key technologies
• Java 8+, Gradle Kotlin DSL
• Freemarker template engine
• ServiceLoader for plugin discovery
• Jackson/Gson for JSON parsing
• Jetty for embedded server
• Node.js + Webpack + Handlebars for frontend
• SCSS/CSS for styling
Essential elements
• Don’t omit the plugin layer—this is what gives Allure its extensibility.
• Both the Java and JS build/deploy paths.
• Separate commands (generate/serve/open) as distinct entrypoints.