I have a multi-project gradle build where I am generating API documentation using enunciate. One of the nice things about this is they generate a client jar containing our dto’s called ‘json-client.jar’. I have attached this artifact to the project (referred to as api) which generated it and am able to successfully add a dependency to it from another project (referred to as api-tests) which will use this to test our API.
This is where my problem lies, and I’m not sure if it is a problem with gradle or a problem with the STS/eclipse gradle plugin. When I import the api-tests project into eclipse, all I get is a project build classpath reference to the api project which generates this jar, and not the jar itself. I would like to just have a classpath reference to the jar, because the api project doesn’t have any real java source. I should note, there is no problem running my api-tests project from the command line (I do not get any compilation errors for unresolved references.)
Is there any way I can rectify this? Either by processing the eclipse classpath file in my build.gradle or something else? I have tried processing the eclipse classpath already, but it did not work:
eclipse {
classpath {
file {
withXml {
def node = it.asNode()
node.appendNode('classpathentry', [kind: "lib", path: "/rest-api/build/docs/build/java-client/json-client.jar"])
}
}
}
}
API build.gradle snippets:
project.ext.docsBuildDir = new File(project.buildDir, "docs/build")
project.ext.jsonClientJar = new File(docsBuildDir, "java-client/json-client.jar")
artifacts {
jsonClient(jsonClientJar) {
name 'json-client'
type 'jar'
builtBy enunciate
}
}
I declare the dependency as such in api-tests
dependencies {
compile project(path: ":docs:rest-api", configuration: "jsonClient")
}
I am using gradle 1.10
Thank you for any help/information.