How to Build an OSGi-Based Cytoscape 3 Plugin on Eclipse
Introduction
This section is a step-by-step instruction for building Cytoscape 3 plugin based on OSGi framework. By following this document, you can create your plugin for Cytoscape 3.
Background
In an OSGi system, everything is a plugin. This means, Cytoscape 3 running on OSGi framework is a collection of plugins called bundle. In this tutorial, you are going to create a very simple plugin (bundle) running with Cytoscape 3.
The main difference between Cytoscape 2.x plugin and 3.x plugin is that you do not have to implement CytoscapePlugin interface in Cytoscape 3. Instead, you need to build your plugin with a metadata file for OSGi. However, this process will be handled by a tool called PAX-Construct and it is automatic.
Requirements
To understand each steps in this document, it is better to understand following before building your plugin:
- Basic Java
- How to build Java project on Eclipse
- OSGi Bundle
- Note: OSGi Bundle = regular jar file + metadata text file.
- OSGi-Dependent API
BundleActivator
Tools
The following tools should be installed on your machine before starting this tutorial:
[http://www.eclipse.org/ Eclipse 3.3/3.4]
[http://maven.apache.org/ Maven] 2.0.9 or later
[http://www.ops4j.org/projects/pax/construct/ Pax-Construct 1.3]
[http://java.sun.com/javase/downloads/index_jdk5.jsp Java SE 5/6]
Eclipse Plugins
[http://m2eclipse.codehaus.org/ m2Eclipse] - Maven integration for Eclipse
[http://subclipse.tigris.org/ Subclipse] - [http://subversion.tigris.org/ Subversion] client for Eclipse
[http://springide.org/blog/ Spring IDE] (Optional)
Procedure
- Open a terminal. Execute the following script:
- Move to the root directory of your plugin project. Now you can see the files like the following:
- Convert this plugin project to Eclipse project
mvn pax:provision
Command Line Tools
Pax-Construct
To generate eclipse project files from projects generated by Pax-Construct, type:
mvn pax:eclipse