Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id EBD9C200CF0 for ; Thu, 7 Sep 2017 13:28:51 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A22081609DB; Thu, 7 Sep 2017 11:28:51 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 9AABC1609A7 for ; Thu, 7 Sep 2017 13:28:50 +0200 (CEST) Received: (qmail 96538 invoked by uid 500); 7 Sep 2017 11:28:49 -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 96528 invoked by uid 99); 7 Sep 2017 11:28:49 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Sep 2017 11:28:49 +0000 Received: from mail-yw0-f182.google.com (mail-yw0-f182.google.com [209.85.161.182]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id 98E7B1A026D for ; Thu, 7 Sep 2017 11:28:47 +0000 (UTC) Received: by mail-yw0-f182.google.com with SMTP id w204so29412944ywg.3 for ; Thu, 07 Sep 2017 04:28:47 -0700 (PDT) X-Gm-Message-State: AHPjjUjES9ZzaGUuyBzTDRyLhKx8AIWp/CI+KSAiYTsbmdCIbrlFpp24 HKmT2O99SEKpfqYJ3JbkyP13/KisKw== X-Google-Smtp-Source: ADKCNb74Jmuco6KQwd+HWrzx2VeM/yDyHKCKieGqGBVSergwPVVqqU37mb4MBGnIHnidiLLuyuMJVJt1P+MZEV586zE= X-Received: by 10.129.175.78 with SMTP id x14mr1769866ywj.289.1504783726375; Thu, 07 Sep 2017 04:28:46 -0700 (PDT) MIME-Version: 1.0 Received: by 10.13.230.87 with HTTP; Thu, 7 Sep 2017 04:28:25 -0700 (PDT) In-Reply-To: <434B9824-44B4-4EAB-85EE-D39142793CDF@gmail.com> References: <434B9824-44B4-4EAB-85EE-D39142793CDF@gmail.com> From: Guillaume Nodet Date: Thu, 7 Sep 2017 13:28:25 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Custom file install in Karaf assembly To: user Content-Type: multipart/alternative; boundary="f403045e582c797cc7055897c3b9" archived-at: Thu, 07 Sep 2017 11:28:52 -0000 --f403045e582c797cc7055897c3b9 Content-Type: text/plain; charset="UTF-8" We have an example in our build. Here's the framework generation: https://github.com/apache/karaf/blob/master/assemblies/features/static/pom.xml It's actually used here: https://github.com/apache/karaf/blob/master/demos/profiles/static/pom.xml A completely different approach may be to blacklist the fileinstall bundle. Add the following in your plugin config: mvn:org.apache.felix/org.apache.felix.fileinstall/3.6.0 2017-09-05 12:19 GMT+02:00 Matteo Rulli : > Hello, > I'm trying to replace the default Felix fileinstall with my custom > implementation. > > To do that I built an alternative framework feature and I generated a KAR > out of it. > > After that I replaced the > > > org.apache.karaf.features > framework > kar > > > dependency in my karaf assembly project with the custom KAR (this is > exacltly the same as the original one except that it contains my custom > fileinstall). Unfortunately when I try to generate the assembly I get this > stacktrace: > > org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute > goal org.apache.karaf.tooling:karaf-maven-plugin:4.1.2:assembly > (default-assembly) on project flairkit.assembly: Unable to build assembly > at org.apache.maven.lifecycle.internal.MojoExecutor.execute( > MojoExecutor.java:213) > at org.apache.maven.lifecycle.internal.MojoExecutor.execute( > MojoExecutor.java:154) > at org.apache.maven.lifecycle.internal.MojoExecutor.execute( > MojoExecutor.java:146) > at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder. > buildProject(LifecycleModuleBuilder.java:117) > at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder. > buildProject(LifecycleModuleBuilder.java:81) > at org.apache.maven.lifecycle.internal.builder.singlethreaded. > SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) > at org.apache.maven.lifecycle.internal.LifecycleStarter. > execute(LifecycleStarter.java:128) > at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309) > at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194) > at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107) > at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993) > at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345) > at org.apache.maven.cli.MavenCli.main(MavenCli.java:191) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke( > NativeMethodAccessorImpl.java:62) > at sun.reflect.DelegatingMethodAccessorImpl.invoke( > DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at org.codehaus.plexus.classworlds.launcher.Launcher. > launchEnhanced(Launcher.java:289) > at org.codehaus.plexus.classworlds.launcher.Launcher. > launch(Launcher.java:229) > at org.codehaus.plexus.classworlds.launcher.Launcher. > mainWithExitCode(Launcher.java:415) > at org.codehaus.plexus.classworlds.launcher.Launcher. > main(Launcher.java:356) > Caused by: org.apache.maven.plugin.MojoExecutionException: Unable to > build assembly > at org.apache.karaf.tooling.AssemblyMojo.execute( > AssemblyMojo.java:268) > at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo( > DefaultBuildPluginManager.java:134) > at org.apache.maven.lifecycle.internal.MojoExecutor.execute( > MojoExecutor.java:208) > ... 20 more > Caused by: java.lang.NullPointerException > at org.apache.karaf.tooling.AssemblyMojo.doExecute( > AssemblyMojo.java:463) > at org.apache.karaf.tooling.AssemblyMojo.execute( > AssemblyMojo.java:262) > ... 22 more > > Looking at the AssemblyMojo code, it seams that this is not the right way > to achieve what I want to do. Could you suggest the right way to replace > fileinstall with a custom implementation in my custom karaf (karaf v. > 4.1.2) assembly? > > Thank you very much, > Matteo > > -- ------------------------ Guillaume Nodet --f403045e582c797cc7055897c3b9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
We have an example in our build.
Here's the framew= ork generation:
It&= #39;s actually used here:
A completely different approach may be to blacklist the fileins= tall bundle.
Add the following in your plugin config:
<= pre style=3D"color:rgb(0,0,0);font-family:Menlo"><blacklistedBundles>
<bundle<= span style=3D"background-color:rgb(239,239,239)">>mvn:org.apache.= felix/org.apache.felix.fileinstall/3.6.0</bundle>
</blacklistedBundles>

=

2017-= 09-05 12:19 GMT+02:00 Matteo Rulli <matteo.rulli@gmail.com>:
Hello,
I'm trying to replace the default Felix fileinst= all with my custom implementation.=C2=A0

To do tha= t I built an alternative framework feature and I generated a KAR out of it.= =C2=A0

After that I replaced the=C2=A0
<= br>
<dependency>
<= font face=3D"Consolas"> <groupId>org.apache.karaf.features</groupId>
<artifactId>framework</artifactId>
<= div> <type>kar</type>
</dependency>

dependency in my karaf assembly project with the custom KA= R (this is exacltly the same as the original one except that it contains my= custom fileinstall). Unfortunately when I try to generate the assembly I g= et this stacktrace:

org.ap= ache.maven.lifecycle.LifecycleExecutionException: Failed to execute go= al org.apache.karaf.tooling:karaf-maven-plugin:4.1.2:assembly (de= fault-assembly) on project flairkit.assembly: Unable to build assembly
=C2=A0 =C2=A0 at org.apache.maven.life= cycle.internal.MojoExecutor.execute(MojoExecutor.java:213)=
=C2=A0 =C2=A0 at org.apache.maven.lifecy= cle.internal.MojoExecutor.execute(MojoExecutor.java:154)
=C2=A0 =C2=A0 at org.apache.maven.lifecycl= e.internal.MojoExecutor.execute(MojoExecutor.java:146)
=C2=A0 =C2=A0 at org.apache.maven.lifecycle.= internal.LifecycleModuleBuilder.buildProject(LifecycleM= oduleBuilder.java:117)
=C2=A0= =C2=A0 at org.apache.maven.lifecycle.internal.LifecycleModuleBui= lder.buildProject(LifecycleModuleBuilder.java:81)
=C2=A0 =C2=A0 at org.apache.maven.lifecycle.= internal.builder.singlethreaded.SingleThreadedBuilder.build(= SingleThreadedBuilder.java:51)
=C2=A0 =C2=A0 at org.apache.maven.lifecycle.internal.LifecycleStarte= r.execute(LifecycleStarter.java:128)
=C2=A0 =C2=A0 at org.apache.maven.DefaultMaven.doExecute= (DefaultMaven.java:309)
=C2= =A0 =C2=A0 at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.jav= a:194)
=C2=A0 =C2=A0 at org.a= pache.maven.DefaultMaven.execute(DefaultMaven.java:107)
=C2=A0 =C2=A0 at org.apache.maven.cli.MavenCli.<= wbr>execute(MavenCli.java:993)
=C2= =A0 =C2=A0 at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)<= /font>
=C2=A0 =C2=A0 at org.apache.maven.= cli.MavenCli.main(MavenCli.java:191)
=C2=A0 =C2=A0 at sun.reflect.NativeMethodAccessorImpl.inv= oke0(Native Method)
=C2=A0 =C2=A0 = at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodA= ccessorImpl.java:62)
=C2=A0 = =C2=A0 at sun.reflect.DelegatingMethodAccessorImpl.invoke(De= legatingMethodAccessorImpl.java:43)
=C2=A0 =C2=A0 at java.lang.reflect.Method.invoke(Method.java:49= 8)
=C2=A0 =C2=A0 at org.codehaus.p= lexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:= 289)
=C2=A0 =C2=A0 at org.cod= ehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:2= 29)
=C2=A0 =C2=A0 at org.codehaus.= plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
=C2=A0 =C2=A0 at org.= codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:= 356)
Caused by: org.apache.maven.p= lugin.MojoExecutionException: Unable to build assembly
=C2=A0 =C2=A0 at org.apache.karaf.tooling.As= semblyMojo.execute(AssemblyMojo.java:268)
=C2=A0 =C2=A0 at org.apache.maven.plugin.DefaultBuildPlu= ginManager.executeMojo(DefaultBuildPluginManager.java:134)
=C2=A0 =C2=A0 at org.apache.maven.l= ifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
=C2=A0 =C2=A0 ... 20 more
Caused by: java.lang.NullPointerException
=C2=A0 =C2=A0 at org.apache.karaf.too= ling.AssemblyMojo.doExecute(AssemblyMojo.java:463)
=C2=A0 =C2=A0 at org.apache.karaf.tooling.A= ssemblyMojo.execute(AssemblyMojo.java:262)
=C2=A0 =C2=A0 ... 22 more

Loo= king at the AssemblyMojo code, it seams that this is not the right way to a= chieve what I want to do. Could you suggest the right way to replace filein= stall with a custom implementation in my custom karaf (karaf v. 4.1.2) asse= mbly?

Thank you very much,
Matteo




--
-----------------------= -
Guillaume Nodet

--f403045e582c797cc7055897c3b9--