MCPcopy Create free account
hub / github.com/fabriciorby/maven-surefire-junit5-tree-reporter

github.com/fabriciorby/maven-surefire-junit5-tree-reporter @v1.5.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.5.1 ↗ · + Follow
220 symbols 496 edges 19 files 6 documented · 3% 1 cross-repo links updated 39d agov1.5.1 · 2025-10-13★ 23010 open issues

Browse by type

Functions 187 Types & classes 33
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Maven Surefire JUnit5 TreeView Extension

If you are a Maven Surefire user and ever wanted a fancy tree output for your tests instead of a bunch of logs, you absolutely should try this.

This is a dependency for maven-surefire-plugin, it adds a tree view for the unit tests executed using JUnit5.

Maven Central Apache License, Version 2.0, January 2004

Installation

The Maven Repository can be found here.

Configure your POM like the following

<plugin>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>3.5.3</version>
    <dependencies>
        <dependency>
            <groupId>me.fabriciorby</groupId>
            <artifactId>maven-surefire-junit5-tree-reporter</artifactId>
            <version>1.5.1</version>
        </dependency>
    </dependencies>
    <configuration>
        <reportFormat>plain</reportFormat>
        <consoleOutputReporter>
            <disable>true</disable>
        </consoleOutputReporter>
        <statelessTestsetInfoReporter
                implementation="org.apache.maven.plugin.surefire.extensions.junit5.JUnit5StatelessTestsetInfoTreeReporter">
        </statelessTestsetInfoReporter>
    </configuration>
</plugin>

Important

Until maven-surefire-plugin:3.5.3 you should use maven-surefire-junit5-tree-reporter:1.5.1.

There was a breaking change in maven-surefire-plugin:3.5.4, and this plugin won't work anymore.

For that version on I plan to continue with maven-surefire-junit5-tree-reporter:2.x.x.

Output Theme

The output can be printed using Themes: - ASCII (default). - UNICODE - EMOJI

EMOJI

<statelessTestsetInfoReporter
        implementation="org.apache.maven.plugin.surefire.extensions.junit5.JUnit5StatelessTestsetInfoTreeReporter">
    <theme>EMOJI</theme>
</statelessTestsetInfoReporter>

Imgur

UNICODE

<statelessTestsetInfoReporter
        implementation="org.apache.maven.plugin.surefire.extensions.junit5.JUnit5StatelessTestsetInfoTreeReporter">
    <theme>UNICODE</theme>
</statelessTestsetInfoReporter>

Imgur

ASCII

<statelessTestsetInfoReporter
        implementation="org.apache.maven.plugin.surefire.extensions.junit5.JUnit5StatelessTestsetInfoTreeReporter">
    <theme>ASCII</theme>
</statelessTestsetInfoReporter>

Imgur

Blank line between tests

<statelessTestsetInfoReporter
        implementation="org.apache.maven.plugin.surefire.extensions.junit5.JUnit5StatelessTestsetInfoTreeReporter">
    <printBlankLineBetweenTests>true</printBlankLineBetweenTests>
</statelessTestsetInfoReporter>

Reduce verbosity

Output in large projects could become too verbose, making failures or errors difficult to find inside the printed trees. To reduce verbosity, you can a hide successful results option can be configured as follows:

<statelessTestsetInfoReporter
        implementation="org.apache.maven.plugin.surefire.extensions.junit5.JUnit5StatelessTestsetInfoTreeReporter">
    <hideResultsOnSuccess>true</hideResultsOnSuccess>
</statelessTestsetInfoReporter>

Failure details

By default, <consoleOutputReporter><disable>true</disable></consoleOutputReporter> disables all console output. To debug test failures, it may be useful to see the console output and stack traces when a test fails. To do so, you can configure this extension like this:

<statelessTestsetInfoReporter
        implementation="org.apache.maven.plugin.surefire.extensions.junit5.JUnit5StatelessTestsetInfoTreeReporter">
    <printStacktraceOnError>true</printStacktraceOnError>
    <printStacktraceOnFailure>true</printStacktraceOnFailure>
    <printStdoutOnError>true</printStdoutOnError>
    <printStdoutOnFailure>true</printStdoutOnFailure>
    <printStdoutOnSuccess>false</printStdoutOnSuccess>
    <printStderrOnError>true</printStderrOnError>
    <printStderrOnFailure>true</printStderrOnFailure>
    <printStderrOnSuccess>false</printStderrOnSuccess>
</statelessTestsetInfoReporter>

Contribute

You are welcome to contribute to the project, for this just open an issue or issue + PR to develop branch.

If you want to create your own output based on the Theme Enum, feel free to open a PR.

Debugging

If you ever want to debug the code, please use the following command

mvnDebug test

Then attach a remote JVM debugger on port 8000

Using SurefireEmulator

This SurefireEmulator class was developed so it's easier to debug the code.

new SurefireEmulator(NestedExampleTest.class).run();

By running this command it's possible to debug the code almost as the actual Surefire was running. And it also returns a List with all the lines that were printed during the test execution.

Core symbols most depended-on inside this repo

browse all functions →

Shape

Method 187
Class 32
Enum 1

Languages

Java100%

Modules by API surface

src/main/java/org/apache/maven/plugin/surefire/report/ReporterOptions.java32 symbols
src/main/java/org/apache/maven/plugin/surefire/extensions/junit5/JUnit5StatelessTestsetInfoTreeReporter.java27 symbols
src/main/java/org/apache/maven/plugin/surefire/report/ActualTreePrinter.java25 symbols
src/main/java/org/apache/maven/plugin/surefire/report/TestReportHandler.java20 symbols
src/test/java/org/apache/maven/plugin/surefire/VeryNestedExampleTest.java18 symbols
src/main/java/org/apache/maven/plugin/surefire/report/Node.java17 symbols
src/main/java/org/apache/maven/plugin/surefire/report/Theme.java14 symbols
src/test/java/org/apache/maven/plugin/surefire/report/SurefireEmulator.java13 symbols
src/test/java/org/apache/maven/plugin/surefire/NestedExampleTest.java11 symbols
src/test/java/org/apache/maven/plugin/surefire/ExampleTest.java8 symbols
src/test/java/org/apache/maven/plugin/surefire/report/ConsoleTreeReporterTest.java6 symbols
src/main/java/org/apache/maven/plugin/surefire/loader/SurefireClassLoaderModifier.java6 symbols

Used by 1 indexed graphs manifest dependencies, hub-wide

For agents

$ claude mcp add maven-surefire-junit5-tree-reporter \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page