Skip to content
Guohui Xiao edited this page Apr 18, 2016 · 17 revisions

Table of Contents

Run/Debug Protege Plugin from IntelliJ

This page describe how to debug Protege Plugin of Ontop from IntelliJ.

If you just want to test the plugin (without debugging), you only need to follow the step of building the protege plugin and run protege as usual.

Build the protege plugin

The suggested procedure is 1. Make sure that the JAVA_HOME environment variable is set. For Mac:

$ vim .bash_profile 
Add this line:  export JAVA_HOME=$(/usr/libexec/java_home)
$ source .bash_profile

2. cd to the directory of ontop and run the script to compile the code and build ontop bundles

$ mvn clean install -DskipTests

3. compile ontop-protege plugin jar file.

$ cd ontop/ontop-protege
$ mvn bundle:bundle 

4. unzip the protege bundle from the ontop-build-dependencies

$ cd ontop-build-dependencies
$ unzip protege-5.0.0-beta-21-platform-independent.zip -d protege
See here in case the folder ontop-build-dependencies is empty.

5. copy the generated plugin from ontop-protege into Protege

$ cp target/it.unibz.inf.ontop.protege-1.17.0-SNAPSHOT.jar ../ontop-build-dependencies/protege/Protege-5.0.0-beta-21/plugins/
Make sure that there is only one Protege plugin in the plugins directory of Protege

Note that every time you modify the code, you need to recompile and build the ontop distribution following the steps previously presented

Debug in IntelliJ

Module Setting

Add jars from Protege to the classpath

bundles/guava.jar bundles/logback-classic.jar bundles/logback-core.jar bundles/slf4j-api.jar bin/org.apache.felix.main.jar bin/protege-launcher.jar

Run Configuration

  • Main Class: org.protege.osgi.framework.Launcher
  • VM Options
-Xmx500M -Xms200M
-Dlogback.configurationFile=conf/logback.xml
-DentityExpansionLimit=100000000 
-Dfile.encoding=UTF-8 
-XX:CompileCommand=exclude,javax/swing/text/GlyphView,getBreakSpot
  • Working Directory: directory of Protege
  • Use classpath of module: ontop-protege

Run / Debug

Clone this wiki locally