karaf-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kurt Westerfeld <kurt.westerf...@gmail.com>
Subject Re: Custom exploded artifact
Date Mon, 04 Jul 2011 02:52:30 GMT
I had a lot of luck using the reference: URL mechanism under Karaf for this
use-case.  You can use reference:file:/.... to the dir you want.

There are two ways it can help.  First, as a developer you can mount a maven
target subdir as an OSGi bundle, but you have to be careful to construct a
completely exploded war using maven-war-plugin and the bundle plugin.  This
works great, as all you have to do is restart your bundle after a build (I
think dev:watch would also help, but haven't tried it).

Second, you can mount a subdir of your choice from a pre-exploded directory
under Karaf.  I think you have to mount it using a relative URL (wish
$karaf.home would work), something like
reference:file:../../../../../webapps/your-webapp, if ${karaf.home} has a
webapps dir and pre-exploded war under it.  The reason for the relative
../../../../.. bit is that the reference URL handler will work for relative
file resolution to the OSGi "base" (can't remember the exact name), which is
the path to
${karaf.home}/system/org/eclipse/osgi/3.6.0.v20100517/osgi-3.6.0.v20100517.jar

While funky, in practice that second part lets you build a custom karaf
build, but unfortunately you can't use a feature bundle with the reference:
URL--you can an NPE.

On Tue, Jun 28, 2011 at 4:30 PM, thomasrynne <thomas.rynne@gmail.com> wrote:

> I am trying to add support for a custom artifact. Our code is broken into
> modules which have a well defined structure so I would like to be able to
> point fileinstall at the directory containing the modules and generate the
> manifest based on some rules (probably using bnd).
>
> I have tried registering an implementation of ArtifactTransformer and
> ArtifactUrlTransformer but I am confused about which I should use, and
> confused about weather exploded artifacts are supported (as changes outside
> the top directory do not always trigger the canHandle method. Also, the
> path
> I get is to data/generated-bundles, not deploy.
>
> I have also looked at the fileinstall source and karaf source but
> everything
> I have found relates to single files, not exploded directories.
>
> Can anyone give me pointers on how exploded artifacts in karaf work and
> what
> hooks I should use to generate the manifest?
>
> thanks,
> Thomas
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/Custom-exploded-artifact-tp3119292p3119292.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

Mime
View raw message