Adding plugin to gradle default classpath

Hi all,

Is there a way to add a given plugin to gradle default classpath? Currently my aproach consists of copying the plugin jar to a folder and reference that folder in the build script.


apply plugin: DeployPlugin

buildscript {

dependencies {

classpath fileTree(dir: ‘lib’, include: ‘*.jar’)



I’m looking for a aproach where there is no need to reference the jar in the build script. I’ve tried to copy it to GRADLE_HOME/lib or GRADLE_HOME/lib/plugins, but it didn’t work :frowning:


You could put the (slightly modified) ‘buildscript’ block into ‘~/.gradle/init.gradle’, or into ‘init.d/init.gradle’ inside your Gradle distribution.

Hi, Thanks for your response. I’ve tried to create a loadPlugin.gradle and moved it to init.d. I’ve got the following error:

A problem occurred evaluating initialization script. You can’t change a configuration which is not in unresolved state!

Here goes the script body: buildscript {

dependencies {

classpath fileTree(dir: “/opt/gradle-1.3/lib/custom-plugins”, include: “*.jar”)

} }

I’m using gradle 1.3.

Any idea?

Someone is trying to configure a configuration after it has been resolved, which isn’t allowed. Typically this happens when a configuration is resolved too early, such as someone iterating over the resolved files in the configuration phase, rather than the execution phase. The full error message should give some more hints.