Creating a Jar of test binaries – Gradle April 16, 2023 by Tarik Changing sourceSets.test.classes to sourceSets.test.output fixes the problem.