plugins {
id ’java-test-fixtures'
}
testImplementation(testFixtures(project(':some-module:some-sub-module')))
If you still need to support the Maven build at the same time, you must make two changes, to make both resources and java classes available to your test jar build. Resources can be specified in the top level of your build config:
<build>
<testResources>
<testResource>
<directory>src/test/resources</directory>
</testResource>
<testResource>
<directory>src/testFixtures/resources</directory>
</testResource>
</testResources>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>add-gradle-testfixtures</id>
<phase>generate-test-sources</phase>
<goals>
<goal>add-test-source</goal>
</goals>
<configuration>
<sources>
<source>src/testFixtures/java</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>