java - Easiest way to build a Karaf plugin -


i have prior java coding experience not knowledge of whole diverse java ecosystem. have been tasked develop small karaf plugin huge system. system utilizing countless of java goodies: camel, karaf, maven , whatnot. have example code need minor changes in , rebuild.

the example maven project (atleast there pom.xml) , should karaf plugin in end. easiest way changes example , rebuild plugin? have never used of above before , changes small installing , configuring alot of stuff seems bit overkill.

where start? :)

i agree tech-idiot, best bet spending time karaf-maven-plugin, can set bundle hand, @ least realize achieved of maven plugin (specially if have lot of dependencies).

a basic osgi bundle (what refer "plugin"), nothing else jar file special plain text file in there, manifest.mf file.

the manifest.mf describes bundle, name, description, how want activate it, , bundle requires run (its dependencies, or imports), has offer other bundles (its exports).

that's sample manifest file taken wikipedia osgi entry:

bundle-name: hello world bundle-symbolicname: org.wikipedia.helloworld bundle-description: hello world bundle bundle-manifestversion: 2 bundle-version: 1.0.0 bundle-activator: org.wikipedia.activator export-package: org.wikipedia.helloworld;version="1.0.0" import-package: org.osgi.framework;version="1.3.0" 

the manifest.mf file packed in meta-inf/manifest.mf folder of jar, so:

  • you can write file hand , add manually generated jar.
  • probably, last 3 elements of sample manifest, you'll need import-package section (no bundle-activator , no export-package)
  • you should declare in import-package each required external package import app , version. keep in mind external dependencies use in app must available in osgi runtime bundle run.

Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

php - joomla get content in onBeforeCompileHead function -