Setting Runtime Dependency in Eclipse Plugin Development
Hi,
I m very new to Eclipse plugin development. I m trying to develop a plugin to extend some features of Rational Team Concert (RTC). I m trying to understand very basic concept here. Whenever we extend some functionality we are adding the corresponding plugin in Dependencies Tab and eventually it gets updated in Manifest.MF. After saving the file i can see the changes under the section Require-Bundle: of Manifest.MF.
My question is - When i deploy the new plugin which i developed, how the runtime environment will be able to pick the plugin from the corresponding path in the file system though in Manifest.mf we just have require-bundle names. ( I understand that during the development time we specify the Target Platform because of which we are able to add the dependent plugin in the Manifest.mf).
I m trying to understand is there any setting or config file in which we specify the path of the SDK or plugin repository when the server starts up. I searched in many sites but i didnt get any solution ( may be its a very basic)
Accepted answer
ok, on the server side, you should be able to find each of those plugins in one of the server plugin directories
on my 3.0.1.1 server these are in one of these directories
Directory of M:\rtc server 3.0.1.1\server\conf\ccm\sites
<p>
11/27/2012 10:32 PM <DIR> enterprise-update-site
11/27/2012 10:31 PM <DIR> rtc-commons-update-site
11/27/2012 10:31 PM <DIR> update-site
</p>
if not, then your sdk and server runtime are out of synch.
the eclipse plugin.xml dependency checker can help make sure at least you have the right info according to the eclipse Window->Preferences->Plugin Development->Target Platform selection.
my operation advisors install without problems like this.. the other thing you could do is to remove the version dependency from manifest.
here is one of my advisor manifest.mf file, note that no specific versions are required.
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Enforce resolving dependencies
Bundle-SymbolicName: Save_Operation_Advisor;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: com.ibm.team.process.common,
com.ibm.team.workitem.common,
com.ibm.team.repository.common,
com.ibm.team.repository.service
Import-Package: org.eclipse.core.runtime,
org.osgi.framework
Bundle-ActivationPolicy: lazy
on my 3.0.1.1 server these are in one of these directories
Directory of M:\rtc server 3.0.1.1\server\conf\ccm\sites
<p>
11/27/2012 10:32 PM <DIR> enterprise-update-site
11/27/2012 10:31 PM <DIR> rtc-commons-update-site
11/27/2012 10:31 PM <DIR> update-site
</p>
if not, then your sdk and server runtime are out of synch.
the eclipse plugin.xml dependency checker can help make sure at least you have the right info according to the eclipse Window->Preferences->Plugin Development->Target Platform selection.
my operation advisors install without problems like this.. the other thing you could do is to remove the version dependency from manifest.
here is one of my advisor manifest.mf file, note that no specific versions are required.
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Enforce resolving dependencies
Bundle-SymbolicName: Save_Operation_Advisor;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: com.ibm.team.process.common,
com.ibm.team.workitem.common,
com.ibm.team.repository.common,
com.ibm.team.repository.service
Import-Package: org.eclipse.core.runtime,
org.osgi.framework
Bundle-ActivationPolicy: lazy
Comments
1 vote
3 other answers
having JUST finished this very thing, you must INSTALL your new plugin, using an update Site
code plugin project<- feature plugin project <- update site plugin project (here is where the build happens, off the site.xml)
then, if you are replacing an IBM provided jar file, because the names are the same(specified in the source import, manifest,mf file, in my case 'Bundle-Version: 1.1.1.v20110524_1821', you have to manually copy your new jar file
in my case "com.ibm.team.feed.core_1.1.1.v20110524_1821.jar"
my update site contains 3 jar files after build complete
then, after install, and copy, you need to do an Eclipse - clean startup..(otherwise eclipse won't read the plugins folder for new files)
you should be able to test the code using a debug version of eclipse from the developer eclipse..
(I launch the 3.0.1.1 eclipse to test, from my 4.x eclipse development environment), the debug pass does a -clean by default
code plugin project<- feature plugin project <- update site plugin project (here is where the build happens, off the site.xml)
then, if you are replacing an IBM provided jar file, because the names are the same(specified in the source import, manifest,mf file, in my case 'Bundle-Version: 1.1.1.v20110524_1821', you have to manually copy your new jar file
in my case "com.ibm.team.feed.core_1.1.1.v20110524_1821.jar"
my update site contains 3 jar files after build complete
then, after install, and copy, you need to do an Eclipse - clean startup..(otherwise eclipse won't read the plugins folder for new files)
you should be able to test the code using a debug version of eclipse from the developer eclipse..
(I launch the 3.0.1.1 eclipse to test, from my 4.x eclipse development environment), the debug pass does a -clean by default
Comments
now that you have BUILT the code (jars) , you have to INSTALL in into eclipse
Help->Install New Software, Add, push Local, navigate to the location of site.xml in your development environment for the update site project. give the entry a Name. press Save
then select the new 'site' in the dropdown, and make sure to deselect group by in the lower left
then select your Update site name. then follow the install button path.
if you are replacing one of the IBM distributed JAR files (like I do), then the install requires one extra step
as the install won't overlay same named files.. you have to do that manually.
then after all that, restart Eclipse with the -clean parameter to get it to re-read the plugins folder..
for Web there is a different process.. you have to deploy to the server\conf\ccm\sites folder and create a provisioning profile, then tell the server to reload plugins, and then restart the server so that it actually does this. (and to uninstall, its the same)..
I know there are documents on the jazz.net/library, but I don't know which one covers which topic anymore. (maybe Ralph will be along soon to help out here)
my client plugin talks to a new server service, so I have to do both.. and one of my prior exercises also had web javascript changes as well.
Help->Install New Software, Add, push Local, navigate to the location of site.xml in your development environment for the update site project. give the entry a Name. press Save
then select the new 'site' in the dropdown, and make sure to deselect group by in the lower left
then select your Update site name. then follow the install button path.
if you are replacing one of the IBM distributed JAR files (like I do), then the install requires one extra step
as the install won't overlay same named files.. you have to do that manually.
then after all that, restart Eclipse with the -clean parameter to get it to re-read the plugins folder..
for Web there is a different process.. you have to deploy to the server\conf\ccm\sites folder and create a provisioning profile, then tell the server to reload plugins, and then restart the server so that it actually does this. (and to uninstall, its the same)..
I know there are documents on the jazz.net/library, but I don't know which one covers which topic anymore. (maybe Ralph will be along soon to help out here)
my client plugin talks to a new server service, so I have to do both.. and one of my prior exercises also had web javascript changes as well.
Hi Sam, Thank you so much for the reply. I completely accept the solution which you provided above for a plugin which works in Eclipse IDE environment.
But in my case what i m trying to do is to deploy a plugin in a server. For example i was trying to follow the example mentioned in the following link. ( https://www.ibm.com/developerworks/mydeveloperworks/blogs/extendingrtc/entry/checksummaryadvisor?lang=en) in which they are trying to extend the Extension point ( com.ibm.team.proccess.service.operationAdvisors).
In this case, plugin will be deployed to a RTC Jazz server (tomcat server with OSGI). I developed the same example and deployed in my local server and when the plugin was starting, it just stopped in INSTALLED state because of missing bundles. Please find the following errors. But all the jars mentioned were part of RTC SDK, still when the plugin is deployed in server its not able to resolve it.
Direct constraints which are unresolved:
Missing required bundle com.ibm.team.process.common_1.2.1.
Missing required bundle com.ibm.team.repository.common_1.1.1.
Missing required bundle com.ibm.team.repository.service_1.1.1.
Missing required bundle com.ibm.team.workitem.common_3.0.1.