Is it possible ask gradle to read plugins version from a gradle.properties file for plugins defined in the plugins block?

Hello,

I can use plugins officially supported by gradle, like java, idea without version definition, like so:

plugin {
  id 'idea'
  id 'java'
  id 'application'
}

and If I would like also use some community plugins, I must specify it version, like so:

id 'org.springframework.boot' version '2.1.2.RELEASE'

I of course can use gradle.properties file, put here needed plugin version like so:

springBootVersion = 2.1.2.RELEASE

and use it in my build.gradle but it wont work for plugins {} clojure anymore, only for plugins defined in buildscript clojure like so:

buildscript {
  dependencies {
    classpath "org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion"
  }
}
/*
plugins { ... }
*/
apply plugin: 'org.springframework.boot'

So my question: is it possible somehow ask gradle pickup right plugin version from gradle.proeprties file without buildscript plugin definition?

Thanks in advice!


Regards,
Maksim

Hi @daggerok!

To answer your question: not yet. This is a limitation of the plugins block and a highly requested feature. Feel free to take a look at the issue on GitHub, upvote it, and subscribe for updates. It was recently picked up by the team and we’re hoping it will be included in the next release – Gradle 5.3.

1 Like

Hello and thank you, @codeJENNerator for pointing me into that GitHub issue!
You have my vote

1 Like