I’m trying to leverage the Hundred Kilobyte Kernel (HK2) framework, however I can’t find any tutorials or working examples of it. I have installed Maven, as it is required, but I can’t find the archetypes to work with. I’m working with Eclipse, and I have only found this Netbeans guide but even the example source files are non existent.
Under Eclipse, I managed to install the m2e maven plugin and I have tried to start a new project, however when I try to search for the hk2 archetype to create my customization of it I can’t find the required resources. I try to create a new project, and then add an archetype, I specify com.sun.enterprise as the group id, the artifact id as hk2 (and hk2-maven-plugin as per some instructions), the latest version I could find (1.6.9) and the remote location as http://download.java.net/maven/glassfish/, but even when the jar files are there, there is no archetype catalog file that I can find. I have also tried adding this location as a Remote Catalog, but since there is no xml file to point to, it says the catalog is empty.
My question is, does anyone have any updated resources or startup steps to create an hk2 module? or can tell me how to use what I have? Inside the jars there are pom.xml files, however if I import those to Eclipse, it has errors that I don’t know how to fix. Development on the project seems almost completely halted (last updates are from jul 2011) but maybe someone already familiar with Glassfish plugin development can point me in the right direction? or maybe could someone recommend an alternative to HK2? If anyone has any good OSGi tutorials that would be nice too, or any other similar framework.
Thanks!
Sounds like you’re better off with OSGi … The HK2 (which would surprise me if it was still 100k) was an attempt to not depend on OSGi directly for Glassfish. I do not think it has a well maintained API.
Since OSGi is a well defined and maintained API, that it runs on Glassfish, and that you also get portability to other environments seems to indicate that the choice for OSGi is smarter. The easiest way to get started is http://bndtools.org/