# Kotlin DSL: how can I use properties in plugin version?

**URL:** <https://discuss.gradle.org/t/kotlin-dsl-how-can-i-use-properties-in-plugin-version/30358>\
**Category:** Help/Discuss\
**Tags:** plugins\
**Created:** [January 29, 2019, 11:20am UTC](https://discuss.gradle.org/t/kotlin-dsl-how-can-i-use-properties-in-plugin-version/30358 "2019-01-29T11:20:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mre](https://avatars.discourse-cdn.com/v4/letter/m/96bed5/32.png) [@mre](https://discuss.gradle.org/u/mre)\
**Post date:** [January 29, 2019, 11:20am UTC](https://discuss.gradle.org/t/kotlin-dsl-how-can-i-use-properties-in-plugin-version/30358/1 "2019-01-29T11:20:51Z")

</div>

Hi,  
I am a beginner in gradle and in kotlin-dsl, after working ten years in maven. If I define a property I can use it in the application dependencies but not in the plugins. Example:  
val kotlinVersion=“1.3.20”  
plugins { id(“org.jetbrains.kotlin.jvm”).version.(kotlinVersion) //wrong  
}  
dependencies{  
implementation(“org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion”) // ok  
}  
How can I use a property both for plugin and dependency versions, as in a pom ?

---

<div class="post-metadata">

**Author:** ![kpramesh2212](https://avatars.discourse-cdn.com/v4/letter/k/96bed5/32.png) [@kpramesh2212](https://discuss.gradle.org/u/kpramesh2212)\
**Post date:** [January 30, 2019, 4:52pm UTC](https://discuss.gradle.org/t/kotlin-dsl-how-can-i-use-properties-in-plugin-version/30358/2 "2019-01-30T16:52:14Z")

</div>

Hi

I dont think you can use a property like the way you described. There seems to be an open issue to support this in future.

However there is an article which says you can do so from your setting.gradle file

> <https://stackoverflow.com/questions/52800536/how-to-use-plugin-version-from-gradle-properties-in-gradle-kotlin-dsl>

---

<div class="post-metadata">

**Author:** ![mre](https://avatars.discourse-cdn.com/v4/letter/m/96bed5/32.png) [@mre](https://discuss.gradle.org/u/mre)\
**Post date:** [January 30, 2019, 6:00pm UTC](https://discuss.gradle.org/t/kotlin-dsl-how-can-i-use-properties-in-plugin-version/30358/3 "2019-01-30T18:00:08Z")

</div>

Yes, you are right. I tried the workaround suggested on [issue #480](https://github.com/gradle/kotlin-dsl/issues/480) , modify settings.gradle.kts and omit plugin version in build.gradle.kts, and it works perfectly.  
Thank you.
