I have a library which is not in any Maven repository, so I include it via
dependencies {
compile files("$PATH/lib.jar")
}
Source and javadoc files are available. I would like to include them into Eclipse / Buildship and access them in the same way as it is possible for libraries downloaded from a repository.
I am using Eclipse Neon 4.6.0, Buildship 1.0.16 and Gradle 2.14.
I’d say the easiest option would be to store your files in a maven-like folder hierarchy
$PATH/xxx/yyy/lib/1.0/lib-1.0.jar
$PATH/xxx/yyy/lib/1.0/lib-1.0-javadoc.jar
$PATH/xxx/yyy/lib/1.0/lib-1.0-sources.jar
$PATH/xxx/yyy/lib/1.0/lib-1.0.pom (not required but maven can generate this for you)
For everybody who does not use maven (like I did not): Apparently, a dot (".) in “xxx” translates into a subfolder ("/") in the path (adjust folder structure accordingly).
This will improve with Gradle 3.0 and the next Buildship release. You’ll be able to freely configure the source attachment of any classpath entry and Buildship will pick that information up. Stay tuned
OK, thanks! This looks like what I need.
As a developer trying to migrate a old build with checked in eclipse files, it’s very hard to understand what buildship currently can do as there seems to be a bit lacking in the documentation.
The stuff in this release note should really be incorporated into the user guide for Buildship at https://github.com/eclipse/buildship/blob/master/docs/user/Overview.md or another guide with more advanced usage.
Anyhow with this stuff being possible, I’m starting to think this Buildship thing is something we can use