# Applying a plugin to all settings

**URL:** <https://discuss.gradle.org/t/applying-a-plugin-to-all-settings/452>\
**Category:** Old Forum Archive\
**Created:** [October 18, 2013, 4:31pm UTC](https://discuss.gradle.org/t/applying-a-plugin-to-all-settings/452 "2013-10-18T16:31:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tilo\_Dickopp](https://avatars.discourse-cdn.com/v4/letter/t/a587f6/32.png) [@Tilo\_Dickopp](https://discuss.gradle.org/u/Tilo_Dickopp)\
**Post date:** [October 18, 2013, 4:31pm UTC](https://discuss.gradle.org/t/applying-a-plugin-to-all-settings/452/1 "2013-10-18T16:31:00Z")

</div>

Is there a way to apply a ‘Plugin\<Settings\>’ to all settings files?

I’m looking for something to put in my ‘init.d’ directory which would be equivalent to this:

allprojects { project -\>

project.buildscript {

repositories.maven { url ‘[http://11.22.33.44/plugins-release](http://11.22.33.44/plugins-release)’ }

dependencies.classpath ‘org.example:my-plugin:1.0.0’

}

}

I know that the the ‘Gradle’ interface doesn’t have an ‘allsettings’ method, but was wondering if there is some kind of hack that anyone has used to achieve this?

---

<div class="post-metadata">

**Author:** ![Peter\_Niederwieser](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@Peter\_Niederwieser](https://discuss.gradle.org/u/Peter_Niederwieser)\
**Post date:** [October 18, 2013, 7:37pm UTC](https://discuss.gradle.org/t/applying-a-plugin-to-all-settings/452/2 "2013-10-18T19:37:00Z")

</div>

What are you trying to achieve? There is only one settings file per build.

---

<div class="post-metadata">

**Author:** ![Tilo\_Dickopp](https://avatars.discourse-cdn.com/v4/letter/t/a587f6/32.png) [@Tilo\_Dickopp](https://discuss.gradle.org/u/Tilo_Dickopp)\
**Post date:** [October 22, 2013, 7:39pm UTC](https://discuss.gradle.org/t/applying-a-plugin-to-all-settings/452/3 "2013-10-22T19:39:00Z")

</div>

Thank you or your quick reply, Peter! Your statement: “There is only one settings file per build.”, helped me a lot to understand how you envision Gradle to be used. In line with that my question would have better been phrased:

> Is there a way to apply a ‘Plugin\<Settings\>’ from a script in ‘init.d’?

I wrote a plugin that converts our internal project ID to a [‘ProjectDescriptor’](http://www.gradle.org/docs/current/javadoc/org/gradle/api/initialization/ProjectDescriptor.html) and want to use that plugin in all our builds. This way it would be easier to maintain all ‘settings.gradle’ files - there are 30+ builds.

Every build creates a deliverable for a certain customer or multi-tenant environment and includes a different set of projects, for example

- build\_1 might include projects A, B, D \* build\_2 might include projects A, C, E, F \* and so on

---

<div class="post-metadata">

**Author:** ![luke\_daley](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/luke_daley/32/9890_2.png) [@luke\_daley](https://discuss.gradle.org/u/luke_daley)\
**Post date:** [October 23, 2013, 11:14am UTC](https://discuss.gradle.org/t/applying-a-plugin-to-all-settings/452/4 "2013-10-23T11:14:00Z")

</div>

The only current hook is: [http://www.gradle.org/docs/current/dsl/org.gradle.api.invocation.Gradle.html#org.gradle.api.invocation.Gradle:settingsEvaluated(groovy.lang.Closure)](http://www.gradle.org/docs/current/dsl/org.gradle.api.invocation.Gradle.html#org.gradle.api.invocation.Gradle:settingsEvaluated(groovy.lang.Closure))

The ‘Settings’ object is still mutable in this callback, but it is _after_ the settings file has been loaded.

I’ve raised GRADLE-2929 as a request to add a hook to get a hold of the ‘Settings’ object before the settings file is executed.
