You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by thomasrynne <th...@gmail.com> on 2011/06/28 22:30:37 UTC

Custom exploded artifact

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.

Re: Custom exploded artifact

Posted by Kurt Westerfeld <ku...@gmail.com>.
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 <th...@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.
>

Re: Custom exploded artifact

Posted by Achim Nierbeck <bc...@googlemail.com>.
Hi Thomas,

you might want to take a look at the war deployer of the pax-web project
it also supports exploded war archives.

https://github.com/ops4j/org.ops4j.pax.web

regards, Achim

Am 28.06.2011 22:30, schrieb thomasrynne:
> 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.


-- 
-----

Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/>  Committer & Project Lead