Accessing Property value to configure version of dependency of custom plugin

Hi. I’m migrating the old plugin gradle-pitest-plugin created in the times of Gradle 1.0 to the Provider/Property API.
One of the main case is a user ability to change the PIT (the tool I call from my plugin) version by overriding default value in the plugin extension. In the past I’ve been just call:

project.afterEvaluate {
        .add(PITEST_CONFIGURATION_NAME, "org.pitest:pitest-command-line:$extension.pitestVersion")

From the guide I know that it could be converted into:

Configuration pitestConfiguration = project.rootProject.buildscript.configurations
pitestConfiguration.defaultDependencies { dependencies ->

However, the problem is to get the value defined by the user in build.gradle (a default value is used).

What is a recommended way/place to create a plugin dependency that depends on a version provided by a user in a plugin configuration?

It turned out that I’ve been setting a default version in the task register action which was overriding a value read from the user configuration. Nevertheless, if you have any other suggestions about the case feel free to reply :).