Custom SourceSet problems

I followed instructions from Effective Gradle implementation and little bit of http://gradle.org/docs/current/userguide/java_plugin.html.

And tried to add a new sourceSet.

sourceSets {
    database {
        resources {
		srcDir "src/main/databases"
		exclude "utils/**/*"
		exclude "template/**/*"
	}
      }
}

I expected gradle to add Rule tasks such as compileDatabaseJava, processDatabaseResources etc., But I cannot find them when I do gradle --tasks --all. What am I missing ?

Note that my database folder only has a resources directory and no java classes. The reason why I chose to add them as a source set is because excludes to this particular databases folder are very specific and cannot be common between this and resources source set.

Have you applied the java plugin as described in the userguide?

Yes I did. Note that this is a sub project and the Java classes in the sub project compile just fine. So I guess Java plugin is indeed applied. (I am not able to share the build script)

My bad - I had placed that code in the wrong project. It works now.