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 DD8029BBC for ; Thu, 19 Jan 2012 12:39:58 +0000 (UTC) Received: (qmail 89512 invoked by uid 500); 19 Jan 2012 12:39:58 -0000 Delivered-To: apmail-karaf-user-archive@karaf.apache.org Received: (qmail 89471 invoked by uid 500); 19 Jan 2012 12:39: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 89463 invoked by uid 99); 19 Jan 2012 12:39:58 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Jan 2012 12:39:58 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [217.70.183.196] (HELO relay4-d.mail.gandi.net) (217.70.183.196) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Jan 2012 12:39:50 +0000 X-Originating-IP: 217.70.178.147 Received: from mfilter19-d.gandi.net (mfilter19-d.gandi.net [217.70.178.147]) by relay4-d.mail.gandi.net (Postfix) with ESMTP id D79CC172090 for ; Thu, 19 Jan 2012 13:39:29 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mfilter19-d.gandi.net Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by mfilter19-d.gandi.net (mfilter19-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id RvTt3GA5BvFl for ; Thu, 19 Jan 2012 13:39:28 +0100 (CET) X-Originating-IP: 82.238.224.4 Received: from [192.168.134.15] (bre91-1-82-238-224-4.fbx.proxad.net [82.238.224.4]) (Authenticated sender: jb@nanthrax.net) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 94A44172085 for ; Thu, 19 Jan 2012 13:39:27 +0100 (CET) Message-ID: <4F180EFE.6060007@nanthrax.net> Date: Thu, 19 Jan 2012 13:39:26 +0100 From: =?ISO-8859-1?Q?Jean-Baptiste_Onofr=E9?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111124 Thunderbird/8.0 MIME-Version: 1.0 To: user@karaf.apache.org Subject: Re: Duplicate feature repository entry using archive-kar to build deployable applications References: <4F0DAFD1.8000307@nanthrax.net> <6B4D58A5-4AED-4BB2-8035-1BA50C9B7FEB@yahoo.com> <4F0F4323.6000205@nanthrax.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Hi Michael, sorry I didn't see your latest message. Let me try a test case on my box. Regards JB On 01/19/2012 01:12 PM, Michael T=E4schner wrote: > Hi JB, > > have you read my previous response? Using the "create-kar" of > feature-maven-plugin of karaf 2.2.x as you described above, adds the > feature.xml twice to the resulting kar file. As a result two feature > repositories are registered in karaf. > > Right now karaf-maven-plugin 3.0.0-SNAPSHOT seems to be broken so I > tried again with the feature-maven-plugin, but the problem persists. > > Do you have an idea how to prevent this duplication ? > > Thanks and Regards, > Michael > > Am 13. Januar 2012 11:18 schrieb Michael T=E4schner > >: > > Hi JB, > > yes I also got the create-kar goal of feature-maven-plugin of karaf > 2.2.x working as you describe above. As a result though the > feature.xml is added twice to the resulting kar file, once in root > folder (because of being available in target/classes) and secondly > within the /repository path because it is defined as feature > description within the feature.xml. As a result on deployment the > feature url/repository is added twice to the karaf container which > was my original question. > > Thanks and Regards, > Michael > > > 2012/1/12 Jean-Baptiste Onofr=E9 > > > Hi Michael, > > Using features-maven-plugin 2.2.5, you have to do something lik= e > > 1. The define a filtered-resources folder in the resources > containing the features.xml file: > > > > > src/main/filtered-__resources > true > > > [...] > > 2. As the packaging is pom (pom), we nee= d > to execute the dependency plugin "explicitly": > > > > org.apache.maven.__plugins > maven-resources-__plugin > > > filter > generate-resources > > resources > > > > > > 3. Now you can define the featuresFile in the create-kar goal o= n > the process-resources phase: > > > org.apache.karaf.__tooling > features-maven-__plugin > 2.2.5 > > > create-kar > process-resources > > create-kar > > > > ${basedir}/__target/classes/features.xml > > > > > > Regards > JB > > > On 01/12/2012 02:12 PM, Michael T=E4schner wrote: > > Hi again, > > I found more details for the karaf-maven-plugin in the doc > and changed > the packaging to "kar". The feature.xml is now read from th= e > src/main/feature folder and contained only once in the > output kar. > Unfortunately now a huge number of bundles are included > which are > inherited from parent projects where I only wanted the > bundles defined > in the input feature.xml. How can I disable the dependencie= s > from being > included in the feature.xml ? I tried with > "__includeTransitiveDependencies" =3D false but that does n= ot > help for > ignoring inherited dependencies. > > Thanks and Regards, > Michael > > Am 12. Januar 2012 11:44 schrieb Michael T=E4schner > > >>: > > > Hi David, > > sorry but I am still confused. I had a look at the 3.0.= 0 > users-guide/kar and it says to put the feature.xml into > src/main/resources: > > > " > xmlns:xsi=3D"http://www.w3.org/__2001/XMLSchema-instance > " > xsi:schemaLocation=3D"http://__maven.apache.org/POM/4.0.0 > > http://maven.apache.org/xsd/__maven-4.0.0.xsd > "> > > 4.0.0 > > my.groupId > my-kar > 1.0 > pom > > > > > org.apache.karaf.__tooling > karaf-maven-__plugin > 3.0.0-SNAPSHOT > > > features-create-kar > > features-create-kar > > > src/main/__resources/features.xml > > > > > > > > > > Can you give me an example with src/main/feature or how > to use the > plugin with dependencies as features ? > > Thanks and Regards, > Michael > > > 2012/1/12 David Jencks > __>> > > > Hi Michael, > > I'm still slightly confused because 3.0.0 does not > have a > feature-maven-plugin, it has a karaf-maven-plugin. > > Using the 3.0.0 karaf-maven-plugin, put your source > feature.xml > in src/main/feature/feature.xml, NOT > src/main/resources/feature.__xml. It will get > filtered before the > feature generation from maven dependencies takes pl= ace. > > Use the kar packaging as explained in the 3.0.0 man= ual. > > Unless you need different start-levels for differen= t > bundles, or > something like config information in the feature > descriptor, you > can have the plugin generate the entire feature.xml > from maven > dependencies. > > hope this helps > david jencks > > > On Jan 12, 2012, at 12:35 AM, Michael T=E4schner wr= ote: > > Hi again, > > sorry for any confusion, I hope to clarify my > goals and > approach. My goal is to generate kar archive fo= r my > multimodule project to deploy them at runtime a= s > self-contained features. For this I set up a > module for > generating the kar from a filtered feature file > to manage the > version information of the project. > > I started using "archive-kar" goal of > feature-maven-plugin of > 3.0.0.SNAPSHOT with the feature.xml residing in > src/main/resources. As the feature.xml has to b= e > filtered > first, I refer to the filtered file as input fo= r > the plugin: > ${project.build.__outputDirectory}/featur= es.xml<__/featuresFile> > > JB recommended using "create-kar" goal of > released karaf > feature-maven-plugin (tried with 2.2.5) and the > feature.xml in > the same folder. > > The result is the same, that the final kar > archive contains 2 > feature.xml files causing karaf to register 2 > feature > repositories, one for the file copied in from > /target/classes > and the other one from > /repository//<__artifactId> ... > > My question was then if one of them could be > removed from the > kar file to prevent duplicate feature repositor= y > entries. > > Feature file (example): > > > xmlns=3D"http://karaf.apache.__org/xmlns/features/v1.= 0.0 > "> > version=3D'${project.version}' > > mvn:${project.groupId}__/common/${project.versi= on} > mvn:${project.groupId}__/businessLogic/${projec= t.__version} > mvn:${project.groupId}__/webservice/${project.v= ersion}__ > > > > Thanks and Regards, > Michael > > > 2012/1/11 David Jencks > __>> > > > I can't tell what you are doing since your > information is > inconsistent. > > If you use the trunk (3.0.0-SNAPSHOT) > karaf-maven-plugin > and the kar packaging your "source" > feature.xml file > should be in src/main/feature/feature.xml. > AFAIK this > works fine. > > I don't know anything about 2.2.x. > > david jencks > > On Jan 11, 2012, at 8:21 AM, Michael > T=E4schner wrote: > > Hi JB, > > I switched to the create-kar goal of > maven-features-plugin of karaf 2.2.5, > yet the issues > remain: If the input feature file uses > properties I can > only use the already filtered file in > target/classes (I > uses ${project.artifactId}, version, > etc.) else the > bundles cannot be resolved. Additionall= y > the resulting > kar still contains two feature files: > the one from build > path (target/classes) and the one withi= n > /repository, > still resulting in two feature > repositories being added > in karaf ? > > Did I do something wrong ? > > Cheers, > Michael > > 2012/1/11 Jean-Baptiste Onofr=E9 > > >> > > > Hi Michael, > > my comments inline: > > > 1: I use the > features-maven-plugin of karaf > 3.0.0-SNAPSHOT to > "archive-kar" my feature from a filtered > features.xml file in > src/main/resources/feature. Thi= s > works fine apart > from the fact that the > resulting kar contains two > features.xml, one in > /features (as copied > from /target/classes/feature) > and one in the > correct place under > > /repository//<____artifactId>-features.x= ml. How > > can I tell the > plugin to ignore the > /target/feature/features.xml > in the kar while I > still need it for the build ? > Right now karaf > shows two added feature > repositories for the same > bundles and I have to > remove one manually. > > > The create-kar goal is now availabl= e > with > features-maven-plugin 2.2.5. > > http://karaf.apache.org/____manual/latest-2.2.x/use= rs-____guide/kar.html > > > > > > I blogged about it: > http://blog.nanthrax.net/2011/____12/do-you-know-th= e-apache-____karaf-maven-plugins/ > > > > > > The create-kar goal take the > featuresFile, so it > should include only this one, and > you shouldn't use a > resource for that. > > > > 2. Undeploy of kar from the > karaf /deploy folder > has currently no > effect, neither the feature > repo, nor the > features/bundles themselves > are undeployed ? Additionally I > wonder what would > happen if I copy a > newer kar of my features to the > /deploy folder ?! > > > It's an expected behavior. Removing > a kar file > doesn't remove the features > installed (and the > bundles/config associated). > On Karaf 2.2.x, the kar is > uncompress in the > local-repo folder, adding a .timest= amp. > If you copy a new KAR, the > KarDeployer will check if > the kar is newer than the previous > .timestamp and so > it will try to update the > features/bundles. Else, > nothing will be performed. > > Regards > JB > > > > I am grateful for any answer an= d > look forward to > hearing from you. > > Kind Regards, > Michael > > > -- > Jean-Baptiste Onofr=E9 > jbonofre@apache.org > > > http://blog.nanthrax.net > Talend - http://www.talend.com > > > > > > > > > > -- > Jean-Baptiste Onofr=E9 > jbonofre@apache.org > http://blog.nanthrax.net > Talend - http://www.talend.com > > > --=20 Jean-Baptiste Onofr=E9 jbonofre@apache.org http://blog.nanthrax.net Talend - http://www.talend.com