Dependency between plugin and project inside same multi-project build

The question is similar to stackoverflow quest (http://stackoverflow.com/questions/17543291/dependency-between-plugin-and-project-inside-same-multi-project-build) with one change - the plugin is used to be a “public”. It means it will be published to maven repo and other projects will use it. So I want to write a “public” gradle plugin but I also want to use the same plugin in same multiproject the plugin is developed in in another module. For example example module will use the plugin to demonstrate how the plugin is used in other applications.

I tried to move plugin to buildSrc but I don’t know how to publish / install such plugin to maven repo. I also tried to extend sources set.

‘’’ sourceSets {

main {

groovy.srcDirs =

["…/my-gradle-plugin/src/main/groovy"]

resources.srcDirs = ["…/my-gradle-plugin/src/main/resources"]

} } ‘’’

But the IntelliJ IDEA has problem to import such gradle project: ‘Can’t register given path of type ‘SOURCE’ because it’s out of content root.’

Thanks for your help, -lk

Same problem here, did you manage to find a solution ?

Thanks, Marc