Build an eclipse plugin project with 3rd party dependencies using buildship

buildship

(Abhinay Agarwal) #1

Hi,

This thread is related to Release buildship build system?

I have been trying to create an eclipse plugin using buildship build system. I have successfully created a plugin, feature and update-site project which compiles and builds.

The plugin(ui) project has a dependency on a third party library and according to the doc, adding the dependency using bundled configuration seems to be the right thing to do. The build.gradle file for the same looks like the following:

apply plugin: eclipsebuild.BundlePlugin

repositories {
    mavenLocal()
}
dependencies {
	compile withEclipseBundle("org.eclipse.swt.${ECLIPSE_WS}.${ECLIPSE_OS}.${ECLIPSE_ARCH}")
	compile project (':org.eclipse.buildship.core')
        bundled 'groupId:dependency:version'
}

I can run the plugin project from eclipse without any issue. But, when I tried to install the plugin using the local repository (after firing the createP2Repository task), the plugin complains that it cannot find a class from the dependency I bundled earlier. I have checked the plugin jar inside repository/plugins directory and the dependency jar is present in its lib directory. The MANIFEST.MF for the plugin jar also has an entry in Bundle-ClassPath: for the dependency.

I am not sure if I am doing something fundamentally wrong for a plugin project which has 3rd party dependencies.

Your time and help is appreciated.

Best regards,
Abhinay