Create a jar jar artifact from the test build output of a project. It can be added as dependency via the 'testArchives' configuration (which will also provide the transitive dependencies).
See jarTest Plugin for usage info.
This a simple demo project for the jarTest plugin.