Index: buildSrc/build.gradle
===================================================================
--- buildSrc/build.gradle	(revision cd9755b)
+++ buildSrc/build.gradle	(revision 760a21d2305debb22199f6d390a7e6698367a47b)
@@ -14,6 +14,7 @@
  * limitations under the License.
  */
 
+apply from: 'repositories.gradle'
 apply plugin: 'groovy'
 apply plugin: 'code-quality'
 apply plugin: 'idea'
@@ -22,9 +23,9 @@
     compile gradleApi()
     compile 'com.google.collections:google-collections:1.0@jar'
     groovy localGroovy()
-    testCompile 'org.jfrog.wharf:wharf-core:1.0+@jar'
     testCompile 'junit:junit:4.8.1@jar'
     testCompile 'org.spockframework:spock-core:0.4-groovy-1.7@jar', 'cglib:cglib-nodep:2.2', 'org.objenesis:objenesis:1.2'
+    testRuntime 'org.jfrog.wharf:wharf-core:1.0+@jar'
 }
 
 apply from: '../gradle/codeQuality.gradle'
Index: buildSrc/repo-init.gradle
===================================================================
--- buildSrc/repo-init.gradle	(revision cd9755b)
+++ buildSrc/repo-init.gradle	(revision 760a21d2305debb22199f6d390a7e6698367a47b)
@@ -18,27 +18,11 @@
 
 addListener(new ArtifactoryGradleSettings())
 class ArtifactoryGradleSettings extends BuildAdapter implements BuildListener {
-
     def void projectsLoaded(Gradle gradle) {
         Project root = gradle.getRootProject()
-        String artifactoryRoot = 'http://repo.jfrog.org/artifactory'
+        if (!'buildSrc'.equals(root.name)) {
-        root.logger.debug("Applying Artifactory to project root ${root.name}")
+            root.logger.debug("Applying Artifactory to project root ${root.name}")
-        root.allprojects {
-            buildscript {
-                repositories {
-                    mavenRepo name: 'plugins-repo', urls: "$artifactoryRoot/gradle-plugins"
+            root.apply from: "${root.projectDir}/buildSrc/repositories.gradle"
-                }
-            }
+        }
+    }
-            repositories {
-                mavenRepo name: 'libs-repo', urls: "$artifactoryRoot/gradle"
-                add(new org.apache.ivy.plugins.resolver.IvyRepResolver()) {
-                    name = 'gradle-ivy'
-                    ivyroot = "$artifactoryRoot/gradle-ivy"
-                    artroot = "$artifactoryRoot/gradle-ivy"
-                    ivypattern = '[organisation]/[module]/ivy-[revision].xml'
-                    artpattern = '[organisation]/[module]/[type]s/[artifact]-[revision](-[classifier]).[ext]'
-                }
+}
-            }
-        }
-    }
-}
Index: buildSrc/repositories.gradle
===================================================================
--- buildSrc/repositories.gradle	(revision 760a21d2305debb22199f6d390a7e6698367a47b)
+++ buildSrc/repositories.gradle	(revision 760a21d2305debb22199f6d390a7e6698367a47b)
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2010 JFrog Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+Project root = project
+String artifactoryRoot = 'http://repo.jfrog.org/artifactory'
+root.logger.debug("Applying Artifactory to project root ${root.name}")
+if ('buildSrc'.equals(root.name)) {
+    repositories {
+        mavenRepo name: 'plugins-repo', urls: "$artifactoryRoot/gradle-plugins"
+        add(new org.apache.ivy.plugins.resolver.IvyRepResolver()) {
+            name = 'gradle-ivy'
+            ivyroot = "$artifactoryRoot/gradle-ivy"
+            artroot = "$artifactoryRoot/gradle-ivy"
+            ivypattern = '[organisation]/[module]/ivy-[revision].xml'
+            artpattern = '[organisation]/[module]/[type]s/[artifact]-[revision](-[classifier]).[ext]'
+        }
+    }
+} else {
+    root.allprojects {
+        buildscript {
+            repositories {
+                mavenRepo name: 'plugins-repo', urls: "$artifactoryRoot/gradle-plugins"
+            }
+        }
+        repositories {
+            mavenRepo name: 'libs-repo', urls: "$artifactoryRoot/gradle"
+            add(new org.apache.ivy.plugins.resolver.IvyRepResolver()) {
+                name = 'gradle-ivy'
+                ivyroot = "$artifactoryRoot/gradle-ivy"
+                artroot = "$artifactoryRoot/gradle-ivy"
+                ivypattern = '[organisation]/[module]/ivy-[revision].xml'
+                artpattern = '[organisation]/[module]/[type]s/[artifact]-[revision](-[classifier]).[ext]'
+            }
+        }
+    }
+}
