How to reference a plugin from a jar in a folder with a relative path

I’ve reviewed the “Multi-Project” chapter in the user guide.

I’ve started a small standalone project as an Eclipse project in my Eclipse workspace. It defines a single plugin. I’ve been working on the unit test infrastructure to verify the business logic, but I also want to implement “system tests” consisting of a standalone build script referencing the plugin.

Ideally, I’d like to do this without rearranging my existing standalone project that defines the plugin, and in a way that doesn’t “smell”.

It would be nice if I could just define a second project in my Eclipse workspace that just references the name of the first project in Gradle project reference form (":projname"). I get the feeling that the only way I could do this is if both the first and second project were both contained in a root project. That would violate my guideline of not rearranging the first project.

The only possibility I can see at this point is to have the second project reference the plugin classes in the first project with a relative path like “…/pluginproject/build/…”, or something like that. I don’t know the exact syntax for this, but I believe this is doable. This seems like a hack, though.

Update:

I changed the title to hopefully be more appropriate.

I now have one project that builds a plugin jar in its “build/libs” folder.

I have another project with the following build script:

buildscript {
 repositories {
  jcenter()
  mavenCentral()
  flatDir {
   dirs "../GradleYangPlugin/build/libs"
  }
 }
    dependencies {
  classpath files("GradleYangPlugin-1.0.0-SNAPSHOT.jar")
 }
}
  apply plugin:"com.att.opnfv.yang.gradle"

This was my guess at how I could reference a plugin built in a sibling project, without defining a multi-project build. This doesn’t work. It says that a plugin with that id is not found.

I tried running the build with a File IO monitor (SysInternals ProcessMonitor), and it seems like Gradle just didn’t grok the relative path I specified for the “dirs” property in the “flatDir” element. ProcessMonitor showed that it went looking for “GradleYangPlugin-1.0.0-SNAPSHOT.jar”, but it didn’t look where I was trying to tell it to look.