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 F28FDD862 for ; Fri, 19 Oct 2012 13:33:34 +0000 (UTC) Received: (qmail 54189 invoked by uid 500); 19 Oct 2012 13:33:34 -0000 Delivered-To: apmail-karaf-user-archive@karaf.apache.org Received: (qmail 54004 invoked by uid 500); 19 Oct 2012 13:33:34 -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 53956 invoked by uid 99); 19 Oct 2012 13:33:32 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Oct 2012 13:33:32 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of m.taeschner@gmail.com designates 209.85.215.176 as permitted sender) Received: from [209.85.215.176] (HELO mail-ea0-f176.google.com) (209.85.215.176) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Oct 2012 13:33:23 +0000 Received: by mail-ea0-f176.google.com with SMTP id n12so195035eaa.21 for ; Fri, 19 Oct 2012 06:33:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=4fp7QfINpqfNKG1XnyFihKqzk0S3BMB2cQggDoOFubw=; b=gYTiZTTJ1ybTToyn94LWaypCMGDeP41vN2mE7acE9KNNxBD3i1kok3yJB1iekzd1hO P5WLH0sbg1zDFmgC1BFRL3oDBS7gdXOwFZoJzOT/lxhrZ+KGA0t/H2D755XDYZ12SldJ jEZH/SpzPBVrtV1vABmIiS/vh67WopD1rSP0fLTjnFxEuqvzPCByeWxEb86i2Btk6V+n OGBgNjh5Z+F6DYAyUoiVM/7kYb9pnVedt4IDcpwgzYtY+UCsNpW7Iy+ZRryJ6yIn6l0w eOlAIPrL9OnxErqDeelqu6XywjbJXPW1y2snLa6kvvPJQbeUo9gCMiuzZj0ArLeY6p0l sDxQ== MIME-Version: 1.0 Received: by 10.14.202.71 with SMTP id c47mr1874603eeo.42.1350653583645; Fri, 19 Oct 2012 06:33:03 -0700 (PDT) Received: by 10.14.101.16 with HTTP; Fri, 19 Oct 2012 06:33:03 -0700 (PDT) In-Reply-To: References: <50812038.6080709@gmail.com> Date: Fri, 19 Oct 2012 15:33:03 +0200 Message-ID: Subject: Re: Kar features.xml file is not filtered From: =?ISO-8859-1?Q?Michael_T=E4schner?= To: user@karaf.apache.org Content-Type: multipart/alternative; boundary=047d7b343e38115cdc04cc698bbe X-Virus-Checked: Checked by ClamAV on apache.org --047d7b343e38115cdc04cc698bbe Content-Type: text/plain; charset=ISO-8859-1 Hi, pick up the filtered file from the target folder. Here's my example config: org.apache.karaf.tooling features-maven-plugin true create-kar process-resources create-kar ${project.build.directory}/doesNotExist false ${project.build.outputDirectory}/feature.xml Regards, Michael P.S.: I do not actually remember why I added the /doesNotExist folder though but feature.xml is located in src/main/resourses 2012/10/19 Giacomo Coletta > This was more or less what I already tried, but alone does not work. > > it seem that the resources:resources goal is not executed during packaging > with pom (while it is with jars). > > i tried a bit more and in the end find something working (even if doesn't > look so clean): > > > > > ${project.basedir}/src/main/feature/ > true > > **/* > > > ${project.basedir}/src/main/filteredFeature/ > > > > > org.apache.maven.plugins > maven-resources-plugin > ${maven-resources-plugin.version} > > > filter > generate-resources > > resources > > > > > > org.apache.karaf.tooling > features-maven-plugin > 2.2.9 > > > create-kar > > create-kar > > > > > ${project.basedir}/src/main/filteredFeature/feature.xml > > > > > > > > > Thanks anyway. > > Giacomo > > 2012/10/19 Christoph Gritschenberger > >> You need to enable resource-filtering in your maven-build. You can set >> this up in your pom.xml like this: >> >> ... >> >> >> >> >> ${project.basedir}/src/main/filtered-resources >> true >> >> **/* >> >> >> >> ... >> >> ... >> >> kind regards, >> christoph >> >> On 19/10/12 11:16, Giacomo Coletta wrote: >> > Hi, >> > >> > i started using the KARs archives, and creates a few KARS using the KAR >> > archetype. >> > >> > one problem I encountered is that the features.xml file included in the >> kar >> > in the generated maven project doesn't seem to be maven filtered by >> default. >> > I would like it to be filtered for managing the included karaf features >> and >> > bundles versions using maven properties like in the following example: >> > >> > >> > >> > >> > mvn:mybundle.groupId/mybundle.ArtifactId/${mybundle.version} >> > >> > >> > >> > >> > i was able to do this while including the features in an assembly using >> the >> > add-features-to-repo goal of the features-maven-plugin (features.xml was >> > filtered by default) >> > >> > I tried to do the same with kars, but I was not able to get to this >> result >> > quickly. >> > May be this is related to the fact that in the features-maven-pluging >> the >> > create-kar goal is tied to the package phase, while >> > the add-features-to-repo was in the compile phase. >> > >> > >> > Does anybody know a standard or easy way to have the features.xml file >> > maven filtered in KARs ? >> > >> > Many Thanks >> > >> > Giacomo >> > >> >> >> > --047d7b343e38115cdc04cc698bbe Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi,

pick up the filtered file from the target folder. Here's my = example config:

=A0=A0=A0=A0=A0 <plugin>
=A0=A0=A0=A0=A0=A0= =A0 <groupId>org.apache.karaf.tooling</groupId>
=A0=A0=A0=A0= =A0=A0=A0 <artifactId>features-maven-plugin</artifactId>
=A0=A0=A0=A0=A0=A0=A0 <extensions>true</extensions>
=A0=A0= =A0=A0=A0=A0=A0 <executions>
=A0=A0=A0=A0=A0=A0=A0=A0=A0 <execu= tion>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <id>create-kar</id&g= t;
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <phase>process-resources</= phase>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <goals>
=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0 <goal>create-kar</goal>
=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0 </goals>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <con= figuration>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <resourcesDir&= gt;${project.build.directory}/doesNotExist</resourcesDir>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <includeDependencies>false<= ;/includeDependencies>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <fe= aturesFile>${project.build.outputDirectory}/feature.xml</featuresFile= >
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 </configuration>
=A0=A0= =A0=A0=A0=A0=A0=A0=A0 </execution>
=A0=A0=A0=A0=A0=A0=A0 </executions>
=A0=A0=A0=A0=A0 </plugin>= ;

Regards,
Michael

P.S.: I do not actually remember why I = added the /doesNotExist folder though but feature.xml is located in src/mai= n/resourses

2012/10/19 Giacomo Coletta <coletta.giacomo@gmail.com>
This was more or less what I already tried, but alone does not work.
it seem that the resources:resources goal is not executed duri= ng packaging with=A0=A0<packaging>pom</packaging> (while it is = with jars).

i tried a bit more and in the end find something workin= g (even if doesn't look so clean):

=A0<= ;build>
=A0 =A0 =A0 =A0 <resources>
=A0 =A0 = =A0 =A0 =A0 =A0 <resource>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 <directory>${project.basedir}/sr= c/main/feature/</directory>
=A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 <filtering>true</filtering>
=A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 <includes>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 <include>**/*</includ= e>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 </includes>
=A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 <targetPath>${project.basedir}/src/main/f= ilteredFeature/</targetPath>
=A0 =A0 =A0 =A0 =A0 =A0 </r= esource>
=A0 =A0 =A0 =A0 </resources>
=A0 =A0 =A0 =A0 <plugins>
=A0 =A0 =A0 =A0 =A0 =A0 <= plugin>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 <groupId>org.apa= che.maven.plugins</groupId>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= <artifactId>maven-resources-plugin</artifactId>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 <version>${maven-resources-plugi= n.version}</version>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 <ex= ecutions>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 <executio= n>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 <id>f= ilter</id>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 <phase>generate-= resources</phase>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 <goals>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 <goal>resources</goal>
=A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 </goals>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 </execution>
= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 </executions>
=A0 =A0 =A0 = =A0 =A0 =A0 </plugin>
=A0 =A0 =A0 =A0 =A0 =A0 <plugin>= ;
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 <groupId>org.apache.karaf= .tooling</groupId>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 <artifactId>features-maven-plugi= n</artifactId>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 <version&= gt;2.2.9</version>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 <exec= utions>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 <execution&= gt;
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 <id>create-kar&l= t;/id>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 <goa= ls>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 &l= t;goal>create-kar</goal>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 </goals>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 <configuration><= /div>

=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 <featuresFile>${project.basedir}/src/main/filteredFeature/fea= ture.xml</featuresFile>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 </configuration>

=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 </execution&= gt;
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 </executions>
=A0 =A0 =A0 =A0 =A0 =A0 </plugin>
=A0 =A0 =A0 =A0 </plu= gins>
=A0 =A0 </build>

Thanks anyway.

Giacomo
2012/10/19 Christoph Gritschenberger <christoph.gritschenberger@gmail.com>
You need to enable resource-filtering in you= r maven-build. You can set
this up in your pom.xml like this:

...
=A0 <build>
=A0 =A0 <resources>
=A0 =A0 =A0 <resource>

<directory>${project.basedir}/src/main/filtered-resources</directo= ry>
=A0 =A0 =A0 =A0 <filtering>true</filtering>
=A0 =A0 =A0 =A0 <includes>
=A0 =A0 =A0 =A0 =A0 <include>**/*</include>
=A0 =A0 =A0 =A0 </includes>
=A0 =A0 =A0 </resource>
=A0 =A0 </resources>
=A0 =A0 ...
=A0 </build>
...

kind regards,
christoph

On 19/10/12 11:16, Giacomo Coletta wrote:
> Hi,
>
> i started using the KARs archives, and creates a few KARS using the KA= R
> archetype.
>
> one problem I encountered is that the features.xml file included in th= e kar
> in the generated maven project doesn't seem to be maven filtered b= y default.
> I would like it to be filtered for managing the included karaf feature= s and
> bundles versions using maven properties like in the following example:=
>
> <features name=3D"myfeatures-repo" version=3D"${myfe= atures-repo.version}">
> =A0 =A0 <feature name=3D"myfeature" version=3D"${myf= eature.version}">
> =A0 =A0 =A0 =A0 =A0 <bundle>
> mvn:mybundle.groupId/mybundle.ArtifactId/${mybundle.version}</bundl= e>
>
> =A0 =A0 </feature>
> </features>
>
> i was able to do this while including the features in an assembly usin= g the
> add-features-to-repo goal of the features-maven-plugin (features.xml w= as
> filtered by default)
>
> I tried to do the same with kars, but I was not able to get to this re= sult
> quickly.
> May be this is related to the fact that in the features-maven-pluging = the
> create-kar goal is tied to the package phase, while
> the add-features-to-repo was in the compile phase.
>
>
> Does anybody know a standard or easy way to have the features.xml file=
> maven filtered in KARs ?
>
> Many Thanks
>
> Giacomo
>




--047d7b343e38115cdc04cc698bbe--