Access DependencyConstraintHandler from Java

I am writing a plugin that amongst other things needs to force the version of various dependencies (think BOM). I’ve found dependency constraints which sound perfect for my needs. But I cannot figure out how to get a DependencyConstraintHandler reference to generate a DependencyConstraint reference to add to the Configuration’s constraints.

Or is there a better way to do what I’m trying?

I have already tried resolution-strategy fwiw. I was not able to get that approach working. Tt kept failing with variant selection problems I did not understand - which lead me to constraints in the first place

Oh, I think I found it. You access this via dependencies, not configurations. Sorry for the noise