Is there a way to use a platform (BOM) to exclude ...
# community-support
j
Is there a way to use a platform (BOM) to exclude a dependency? I’m in an environment where we have a bunch of services in separate repos and a shared code package that publishes various libraries, including a
platform
that everything else depends on and pins versions of common dependencies. We’ve had issues with accidentally using JUnit 4 annotations (almost everything is on Jupiter but some libraries still pull in JUnit 4 as a transitive dependency). I can add an exclude rule to each separate repo (in configurations.testCompileClasspath) and that works, but I’d really like to be able to add something to the platform config that blocks JUnit 4 in everything that depends on the platform. Is this possible?
v
I'm not fully sure, but at least you could make it fail if such a dependency is found by having in the platform a strict version for the dependency that does not exist, then I think you should get an error if the dependency appears in the dependency tree.