Plugin java-test-fixtures cannot resolve Spring Boot starter dependencies

we have rather complicated structure of our modules but I tried to add java-test-fixtures to one of my Gradle subprojects but build suddenly started to fail with:

* What went wrong:
Execution failed for task ':modules:transform:compileTestFixturesJava'.
> Could not resolve all files for configuration ':modules:transform:testFixturesCompileClasspath'.
   > Could not find org.springframework.boot:spring-boot-starter-actuator:.
     Required by:
         project :modules:transform
   > Could not find org.springframework.boot:spring-boot-starter-web:.
     Required by:
         project :modules:transform

(and some others). I only added id "java-test-fixtures" line into the script. And we use Spring Boot in our project. But I am super puzzled why it cannot be resolved now.

Does fixture plugin somehow have troubles with Spring Boot dependency plugin or something?
→ We are using Gradle 7.5.1

Thanks for pointing me into any direction.

Try using the built-in BOM support instead.
The Spring dependency management plugin is a relict from times when Gradle had no built-in BOM support and even its maintainer recommends to use the built-in functionality instead.

I will happily try. I want to switch to version catalog anyway. Thank you very much.

But I have to admit I am quite confused right now. There are two plugins:

  • org.springframework.boot
  • io.spring.dependency-management

I am not sure which one should I remove. Or maybe there is a blog post or a page explained how to replace Spring dependency management plugin?

You still need org.springframework.boot.
You want to remove the dependency management one and instead use a platform(...) dependency as documented in the spring boot documentation.

Oh, yes. I really found some weird mix of features/plugins and some of them are deprecated as well. After removing the plugin and some strange functions it works in my module.

Thank you very much Björn!

1 Like