From dev-return-13113-archive-asf-public=cust-asf.ponee.io@karaf.apache.org Thu Sep 13 15:53:45 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id C46A1180649 for ; Thu, 13 Sep 2018 15:53:44 +0200 (CEST) Received: (qmail 97662 invoked by uid 500); 13 Sep 2018 13:53:43 -0000 Mailing-List: contact dev-help@karaf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@karaf.apache.org Delivered-To: mailing list dev@karaf.apache.org Received: (qmail 97641 invoked by uid 99); 13 Sep 2018 13:53:43 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Sep 2018 13:53:43 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id BFC7B18000B for ; Thu, 13 Sep 2018 13:53:42 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.28 X-Spam-Level: X-Spam-Status: No, score=0.28 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 57FKNd_3rCzd for ; Thu, 13 Sep 2018 13:53:40 +0000 (UTC) Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 322975F3EE for ; Thu, 13 Sep 2018 13:53:39 +0000 (UTC) X-Originating-IP: 82.238.224.4 Received: from [192.168.134.109] (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 0C2A5E0007 for ; Thu, 13 Sep 2018 13:53:38 +0000 (UTC) Subject: Re: [PROPOSAL] Simplify the karaf-maven-plugin to easily create custom distribution To: dev@karaf.apache.org References: <8b52be68-fa4b-1065-f278-706d68d94fdd@nanthrax.net> From: =?UTF-8?Q?Jean-Baptiste_Onofr=c3=a9?= Message-ID: Date: Thu, 13 Sep 2018 15:53:38 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Thanks for your feedback Greg. I started a new local branch with "new" karaf-maven-plugin custom distribution approach. This branch also contains an example. I will create a corresponding PR and an update on the mailing list to be able to discuss all together. Regards JB On 13/09/2018 14:18, Grzegorz Grzybek wrote: > Hello > > Thanks JBO for the idea. True - custom distro generation isn't that > intuitive as it could be. Personally I missed the flexibility, not > simplicity, that's why I added custom in > "[KARAF-5468] Cleaning up AssemblyMojo, Profiles and profile Builder". > > Without it, the implied value for "framework" property was "framework" or > "static-framework" depending on whether you had dependency on > mvn:org.apache.karaf.features/framework/VERSION/kar or > mvn:org.apache.karaf.features/static/VERSION/kar in your POM. The > discovered "framework" property was added as "startup feature" which was > very confusing (mixing "framework" and "feature" concepts). > > I can't tell much about improvements for > karaf-maven-plugin:features-generate-descriptor, because I always preferred > manual creation of feature XMLs. > > However having dependency on existing karaf distro ("standard" apache-karaf > or apache-karaf-minimal) is good idea! karaf-maven-plugin:assembly could > search zip or tar.gz or tgz kind of dependencies (with "provided" or any > other scope) and: > - unpack it > - check etc/profile.cfg > > etc/profile.cfg is (since 4.2.0) nicely written as (official > apache-karaf-minimal distro): > > # > # Profile generated by Karaf Assembly Builder > # > > # Parent profiles > attribute.parents = generated-startup generated-boot generated-installed > > # Attributes > attribute.overlay = true > > # Feature XML repositories > repository.mvn\:org.apache.karaf.features/framework/4.2.0/xml/features = > mvn:org.apache.karaf.features/framework/4.2.0/xml/features > repository.mvn\:org.apache.karaf.features/standard/4.2.0/xml/features = > mvn:org.apache.karaf.features/standard/4.2.0/xml/features > repository.mvn\:org.apache.karaf.features/spring/4.2.0/xml/features = > mvn:org.apache.karaf.features/spring/4.2.0/xml/features > > # Features > feature.framework = framework > feature.jaas = jaas > feature.shell = shell > feature.feature = feature > feature.ssh = ssh > feature.bundle = bundle > feature.config = config > feature.log = log > > However, with complex distros it can look like this (my distro) - see all > the blacklisted items and even special configuration options - these are > all generated from pom.xml: > > # > # Profile generated by Karaf Assembly Builder > # > > # Parent profiles > attribute.parents = generated-startup generated-boot generated-installed > > # Attributes > attribute.overlay = true > > # Feature XML repositories > repository.mvn\:org.apache.karaf.features/framework/4.2.0/xml/features = > mvn:org.apache.karaf.features/framework/4.2.0/xml/features > ... > # Features > feature.framework = framework > feature.patch-management = patch-management > ... > feature.pax-jms-config = pax-jms-config > feature.pax-jms-pool-narayana = pax-jms-pool-narayana > feature.pax-jms-pool-transx = pax-jms-pool-transx > > # Bundles > ... > bundle.mvn\:org.bouncycastle/bcprov-jdk15on/1.60 = > mvn:org.bouncycastle/bcprov-jdk15on/1.60 > bundle.mvn\:org.bouncycastle/bcpkix-jdk15on/1.60 = > mvn:org.bouncycastle/bcpkix-jdk15on/1.60 > > # Configuration properties for etc/config.properties > config.karaf.delay.console = true > > # Blacklisted repositories > blacklisted.repository.mvn\:org.ops4j.pax.cdi/pax-cdi-features/1.0.0.RC1/xml/features > = mvn:org.ops4j.pax.cdi/pax-cdi-features/1.0.0.RC1/xml/features > ... > > # Blacklisted features > blacklisted.feature.httplite = httplite > blacklisted.feature.jetty/[8,9) = jetty/[8,9) > blacklisted.feature.pax-*jetty* = pax-*jetty* > blacklisted.feature.cxf-*-jetty = cxf-*-jetty > ... > > # Blacklisted bundles > blacklisted.bundle.mvn\:org.ops4j.pax.cdi/pax-cdi-jetty-weld = > mvn:org.ops4j.pax.cdi/pax-cdi-jetty-weld > > This etc/profile.cfg can be treated simply as it was added in > karaf-maven-plugin:assembly configuration itself! > > > > path/to/profile.cfg > > > > best regards > Grzegorz Grzybek > > czw., 13 wrz 2018 o 13:51 Jean-Baptiste Onofré napisał(a): > >> Hi guys, >> >> Recently, we received a lot of questions around how to create Karaf >> custom distribution based on karaf-maven-plugin, and how to use the >> static profile to create "standalone/static" distribution. >> >> If the plugin works fine, it's not easy to understand some "details", >> like the dependency scope impact, or providing the set of default >> features repos and features. I already helped users (in private >> communication) to fix their custom distributions. >> >> Obviously, we should simplify the way of creating custom distribution, >> especially with the new tooling & feature we now provide around Docker. >> >> I would like to propose the following: >> >> 1. Set the default behavior of the assembly goal to create a custom >> distribution based on standard. For the user, instead of providing >> (again) all framework, standard, enterprise features repos and all >> standard boot features (shell, ...), it will just specify the tar.gz/zip >> base and his own features repo/repos (or the goal will use the same >> version of the goal plugin itself). All the rest will be done by the >> plugin for him. Use the karaf packaging as default to define this. At >> the end of the day, the user pom.xml will look like: >> >> >> foo >> bar >> 1.0-SNAPSHOT >> karaf >> >> >> >> org.apache.karaf >> apache-karaf >> 4.2.1 >> tar.gz >> >> >> foo >> my >> 1.0-SNAPSHOT >> features >> xml >> >> >> >> >> >> >> org.apache.karaf.tooling >> karaf-maven-plugin >> true >> true >> >> >> my >> >> >> my-other >> >> >> >> >> >> >> >> >> The idea is to automatically execute install-kar + assembly for the >> karaf packaging and let the user focus on its own resources (features, >> config, ...) just providing the base Karaf archive. >> The user will be able to use src/main/resources to provide any files in >> etc, bin, or whatever in the resulting custom distribution. >> >> 2. Improve a bit the features XML generation >> If the custom distribution is the highest priority, just after the >> improvements on this area, I would like to improve the way of creating >> features XML. >> Now, to be honest, almost all of us write features repos XML by hand. It >> gives us the maximum of flexibility. However, on the other hand, the >> features XML and code contain should be sync. >> I would like to improve the generate features MOJO, however leveraging >> most of all functionalities around features (prerequisites, dependency >> flag, inner features, ...). >> >> I have to dig a little bit around that, but if you want some ideas >> already, please let me know. >> >> Thoughts ? >> >> Regards >> JB >> -- >> Jean-Baptiste Onofré >> jbonofre@apache.org >> http://blog.nanthrax.net >> Talend - http://www.talend.com >> > -- Jean-Baptiste Onofré jbonofre@apache.org http://blog.nanthrax.net Talend - http://www.talend.com