Sunday, April 13, 2014

Build an executable jar from a maven project

Not all the jar files are executable because there should be a well defined access point (public static void main(String[] args)) for a jar package to be executable.

Add the following plugin under plugins in your pom file. Eg: If I have my main method in class named,, I add the following.


Thursday, April 3, 2014

Package code with dependencies in Maven

1. Add the following part to the project pom file.



2. package the code with the support of assembly plugin.

mvn clean package assembly:assembly 

3. This will generate two packages, one without dependencies and another with all the project dependencies. The latter is ready to be shipped directly.

Sunday, March 23, 2014

Arches data model and Core Data Standard(CDS)

The goal of this post is to explain the existing Arches data model and suggest a better data model fully based on standard data exchange models like XML or JSON. This should be referred as an extension to the GSoC 2014 proposal submitted by me(Tharindu Rusira) with the title "Data import/export improvements for Arches".

Arches Core Data Standard(CDS) handles the data model in Arches.The following section will explain the existing Arches data model.

Arches system concept glossary is here which defines 7 types of concepts.

Tuesday, March 11, 2014

Sphinx4 maven dependency

Sphinx4-1.0beta6 maven dependency is not available via maven central repository. But there is repository at Sonatype nexus repositories[1] and we can add Sphinx4 to our project by modifying the pom.xml as follows.

Add repository location between <repositories></repositories>

    <id>ow2 Legacy Releases</id>


Now add the following dependency


and you are done. Save pom.xml and build the project.


Friday, March 7, 2014

Stanbol Enhancement Engine fundamentals

The following steps will setup a new Stanbol enhancement engine and launch it as an OSGi bundle in Stanbol's integrated Apache Felix OSGi bundle management console.

1. Apache Stanbol defines 3 Maven archetypes that can be used in developing Stanbol components.
If Stanbol is built correctly, these three archetypes must be present in our local archetype catalog.
Check the presence of Stanbol archetypes.
cat ~/.m2/archetype-catalog.xml

If the file contains the following section, we are good to go with the rest of the process. The highlighted section is what we will be using for enhancement engines so we must at least have it.

      <description>Archetype for a project that accesses the entityhub, and logs queries to a persisten graph</description

      <description>Archetype for a project that allows posting files and shows the computed enhancements.</description>

      <description>Parent POM for the Apache Stanbol project</description>

Thursday, March 6, 2014

Remote debugging in Eclipse

Steps to debug a program running on a remote server

1. Launch the application(eg. xyz.jar) with Xdebug options 

java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8345 -jar xyz.jar

Interpretation of these -Xrunjdwp properties are explained here[1] [2]

Fork me on GitHub