Maven - test jar

Card Puncher Data Processing


A test jar is a jar file used to share test code between module.


In two steps:

Creation of the test jar

  • Creating the test jar that is shared with the other modules (ie all test class will be package in a test jar)

Adding it as a dependency

  • Then in the module that uses this class, add it as dependency



instead of


will not work during a reactor build of the test JAR module and any consumer if a lifecycle phase prior to install is invoked. In such a scenario, Maven will not resolve the test JAR from the output of the reactor build but from the local/remote repository.

Documentation / Reference

Discover More
Card Puncher Data Processing
Maven - Test

Test is a phase that: execute the tests. test the compiled source code using a suitable unit testing framework. These tests should not require the code be packaged or deployed The Maven lifecycle...

Share this page:
Follow us:
Task Runner