Maven Surefire Stack Trace Problem

Asynchronous Transactions
Reliable developer focused Java application performance monitor

For some months we have been having problems with maven-surefire-plugin showing very strange exception stack traces.

After some searching, I found out that maven-surefire-plugin has a trimStackTrace configuration option which is set to true by default. See

I have no idea who thought that removing part of the stack trace would be a good idea, but it’s caused us no end of problems. Especially with rare/random test failures as we don’t get the full stack trace to see what really failed.

To change this ‘feature’ you simply define surefire configuration in your pom.xml. E.g.


You should also be aware that maven-failsafe-plugin has the exact same option. The trimStackTrace is also set to true by default. See

You can disable this by adding the same configuration to the failsafe plugin. E.g.