Understanding dependencies in multi module project with Spring Boot Plugin

Hi,

I am using Gradle v7.3 with Java 11 and in combination with the Spring Boot Gradle Plugin and a multi module project structure.

I am struggling to understand fully how to use ‘variants’ or ‘capabilities’ to establish dependencies between two modules.

I have the following modules:

app
component-test

The app module is producing a ‘boot Jar’ as opposed to a traditional Jar as a result of the Spring Boot plugin.

The component-test module has a dependency on the app module for test purposes, more specifically the main java source set and the transitive dependencies. (so textFixtures don’t do what I want here).

If I wasn’t applying the Spring Boot Gradle plugin on this module and was using the java-library plugin I would have a dependency in the component-test build.gradle that looks like this:

testImplementation project(":app")

Could somebody help me understand how the ‘variants’ and ‘capabilities’ work to establish the right dependency here?

Thanks a lot!