[an error occurred while processing this directive]
USERS
DEVELOPERS


 plug-in debugging tips

The plugins subdirectory of the Protégé installation directory is on the classpath when Protégé starts up and thus classes in the plugins/your-plugin subdirectory can be loaded. One easy way to test and debug plug-ins is to configure your development environment so that your .class files are produced directly into this directory (plugins/your-plugin). They will then be seen the next time Protégé runs.

If you wish to place and use break points within your code, you will want to declare a main() method in your plug-in that calls the Protégé Application.main() method and configure your development environment to run your plug-in class as the main application. E.g.:
public class MyTabPlugin extends AbstractTabWidget {
   public static void main(String[] args) {
      edu.stanford.smi.protege.Application.main(args);
   }
   ...
}
When a plug-in is packaged as a JAR file, the system can find and use the plug-in because it reads the manifest contained in the JAR. When you are developing your plug-in and compiling into the plugins/your-plugin directory, you will need to edit the file plugins/your-plugin/meta-inf/manifest.mf to provide the information the system needs to use your plug-in. This file can contain information about all plug-ins which you are developing (that is, which exist as class files in the plugins/your-plugin directory). When you have completed debugging your plug-in and want to build a JAR file, you can then use this manifest as the manifest for your JAR.

**Please note: Having the same or different versions of the same set of classes both as .class files in the plugins/your-plugin directory and as entries in a JAR file is very bad. This situation will produce many strange errors which will be difficult to understand. Once you produce a JAR file and put it in the plugins/your-plugin directory, be sure to delete the corresponding .class files and change the manifest file in the plugins/your-plugin/meta-inf directory to remove any references to the plug-ins in the JAR file.


[an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive]