Return-Path: X-Original-To: apmail-karaf-user-archive@minotaur.apache.org Delivered-To: apmail-karaf-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2CFFF6D1D for ; Mon, 4 Jul 2011 02:53:00 +0000 (UTC) Received: (qmail 22329 invoked by uid 500); 4 Jul 2011 02:52:59 -0000 Delivered-To: apmail-karaf-user-archive@karaf.apache.org Received: (qmail 22196 invoked by uid 500); 4 Jul 2011 02:52:58 -0000 Mailing-List: contact user-help@karaf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@karaf.apache.org Delivered-To: mailing list user@karaf.apache.org Received: (qmail 22188 invoked by uid 99); 4 Jul 2011 02:52:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Jul 2011 02:52:57 +0000 X-ASF-Spam-Status: No, hits=2.8 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of kurt.westerfeld@gmail.com designates 209.85.215.176 as permitted sender) Received: from [209.85.215.176] (HELO mail-ey0-f176.google.com) (209.85.215.176) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Jul 2011 02:52:51 +0000 Received: by eya28 with SMTP id 28so2170695eya.21 for ; Sun, 03 Jul 2011 19:52:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=JpCp6tr17vieq9NQJYEEhFaBX0z8d8+W04AXxfCNDKo=; b=A4iSc7uU9MmiEBV9pN36l88Uji5xGRm1wra245AxfHtF6jlEXqB9ZnvmsI9nZpv7xw FjAHEIsvl/qI1yxw9EBA6THyXGfzfFo/+UZ23wsuXPLo7j4WSdam5xp9WuEFXV95s+gZ 8UK8A2Yx+J4adnJHVbizoEmJOg6crkXnKOCGQ= MIME-Version: 1.0 Received: by 10.213.10.70 with SMTP id o6mr451808ebo.75.1309747950318; Sun, 03 Jul 2011 19:52:30 -0700 (PDT) Received: by 10.213.113.141 with HTTP; Sun, 3 Jul 2011 19:52:30 -0700 (PDT) Reply-To: kurt@westerfeld.com In-Reply-To: <1309293036955-3119292.post@n3.nabble.com> References: <1309293036955-3119292.post@n3.nabble.com> Date: Sun, 3 Jul 2011 22:52:30 -0400 Message-ID: Subject: Re: Custom exploded artifact From: Kurt Westerfeld To: user@karaf.apache.org Content-Type: multipart/alternative; boundary=0015174be95e52f40f04a735756e --0015174be95e52f40f04a735756e Content-Type: text/plain; charset=ISO-8859-1 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 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. > --0015174be95e52f40f04a735756e Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I had a lot of luck using the reference: URL mechanism under Karaf for this= use-case.=A0 You can use reference:file:/.... to the dir you want.=A0
=
There are two ways it can help.=A0 First, as a developer you can mount = a maven target subdir as an OSGi bundle, but you have to be careful to cons= truct a completely exploded war using maven-war-plugin and the bundle plugi= n.=A0 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).=A0 <= br>
Second, you can mount a subdir of your choice from a pre-exploded direc= tory under Karaf.=A0 I think you have to mount it using a relative URL (wis= h $karaf.home would work), something like reference:file:../../../../../web= apps/your-webapp, if ${karaf.home} has a webapps dir and pre-exploded war u= nder it.=A0 The reason for the relative ../../../../.. bit is that the refe= rence URL handler will work for relative file resolution to the OSGi "= base" (can't remember the exact name), which is the path to ${kara= f.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 refer= ence: 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 art= ifact. 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<= br> 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 pat= h
I get is to data/generated-bundles, not deploy.

I have also looked at the fileinstall source and karaf source but everythin= g
I have found relates to single files, not exploded directories.

Can anyone give me pointers on how exploded artifacts in karaf work and wha= t
hooks I should use to generate the manifest?

thanks,
Thomas

--
View this message in context: http://k= araf.922171.n3.nabble.com/Custom-exploded-artifact-tp3119292p3119292.html
Sent from the Karaf - User mailing list archive at Nabble.com.

--0015174be95e52f40f04a735756e--