Jacoco Report Aggregation Plugin - Spring Dependency Management

I’m doing a migration of aggregated code coverage from script Reporting code coverage with JaCoCo Sample to The JaCoCo Report Aggregation Plugin
This is a SpringBoot project and as it’s or it was a common practice, it uses Dependency Management Plugin Dependency Management Plugin.

After I run testCodeCoverageReport task to aggregate test reports I get following exceptions. I assume this is because I use BOM and dependency version constraint from within dependencyManagement instead of native Gradle dependency constraints.
Exception below:

Execution failed for task ':testCodeCoverageReport'.
> Could not resolve all files for configuration ':allCodeCoverageReportClassDirectories'.
   > Could not find com.pizza.infrastructure:logging:.
     Required by:
         project : > project :pizza-server
   > Could not find com.pizza.infrastructure:multitenancy:.
     Required by:
         project : > project :pizza-server
   > Could not find com.pizza.infrastructure:rest:.
     Required by:
         project : > project :pizza-server
         project : > project :pizza-server > project :pizza-rest
   > Could not find com.pizza.infrastructure:rest-test:.
     Required by:
         project : > project :pizza-server

Is there some workaround, to be able to still rely on dependencyManagement plugin and also be able to use jacoco aggregation plugin?

using dependencyManagement is not recommended, I think platform is a better choice
can refer to spirng platform

2 Likes