'Override external plugin version in precompiled script plugin

I am using Gradle build tool. I have a precompiled Gradle script plugin X, lets say this is a convention plugin. In build.gradle of plugin I define dependency on another external plugin Y.

plugin X:build.gradle:

dependencies {
  implementation "com.rivancic.y:y-gradle-plugin:${versionYPlugin}"
}

plugin X:gradle.properties

versionYPlugin:1.0.0

Then in my main project, I apply precompiled script plugin X and I want to manually set version of external plugin Y. Is that possible? I can't find a way to override the plugin Y version from A.

If I define in project A:gradle.properties the version

versionYPlugin=1.1.0

it doesn't help, still version 1.0.0 is being resolved.

Is there any other way if I want that external plugin version can be dynamically set?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source