How to develop plug-ins and deploy them in LarKC using Eclipse
Requirements:
- Eclipse with m2clipse
Eclipse 3.7 (Java package) carries with the plug-in (download)
In other version of Eclipse the plug-in should be installed (starting from here)
Maven http://maven.apache.org/
Importing the LarKC platform:
Donwload LarKC 2.5 from the source code from the SVN trunk
- Import the project in Eclipse:
File -> Import... -> Existing Maven Projects
- Select the platform root directory (where the POM.xml is located) and Import it
- Create the running configuration:
Run -> Run Configurations...
Right click on Java Application -> New
- Name: LarKC
- On the Main tab:
- Project: platform;
- Main class: eu.larkc.core.Larkc
- On the Arguments tab:
- Program arguments: -plugindir=plugins
- VM arguments: -Xmx512M
- Apply
- Now the LarKC platform can be started
Run -> LarKC
Check if LarKC is running checking http://localhost:8182
- Shut down LarKC
Configuring Eclipse
Defining the platform root variable in Eclipse
Window -> Preferences -> General -> Workspace -> Linked Resources -> New...
- Name: PLATFORM_ROOT
- Location: absolute path pointing the platform folder
Importing the LarKC Plugin archetype in Eclipse
Window -> Preferences -> Maven -> Archetypes
- Add Remote Catalog
Catalog File: http://larkc.svn.sourceforge.net/svnroot/larkc/trunk/larkc-plugin-archetype
- Description: LarKC Plugin Archetype
Creating a plug-in
From Command Line
- Go to the folder where you want to put the source code of your plug-ins
Execute: mvn archetype:generate -DarchetypeCatalog=http://larkc.svn.sourceforge.net/svnroot/larkc/trunk/larkc-plugin-archetype
Continue with the generation of the plug-in (see Section 5.1.1 in the LarKC 2.5 manual and here)
- Import the plug-in in LarKC
File -> Import... -> Existing Maven Projects
- Select the Root Directory (where the POM.xml is located) and Import it
From Eclipse (it probably doesn't work...)
File -> New... -> Maven Project
- In Archetype Selection:
- Catalog: LarKC Plugin Archetype
- select the larkc-plugin-archetype
- Configure the LarKC plug-in description and press Finish
Configure the deploy folder of the plug-in (i.e. let the platform know of your newly created plug-in)
- In the plug-in Eclipse project, add a new folder
File -> New... -> Folder
- Folder Name: bin
Advanced -> Link to alternate location (Linked Folder)
PLATFORM_ROOT/plugins/<plugin-name> (where <plugin-name> is the folder name)
Right click on the plug-in -> Build path -> Configure build path -> Source
- Modify all the Output folders in order to point their bin directory (see red boxes in the image)
- Remove the ** from the exclusion from resources (see blue box in the image)
- Add the lib folder in order to automatically deploy the libraries with the plug-in into the plugin folder
- Select src/main/resources
File -> New... -> Folder
- Folder Name: lib
Advanced -> Link to alternate location (Linked Folder)
- PROJECT_LOC/lib
