From dev-return-100247-apmail-cocoon-dev-archive=cocoon.apache.org@cocoon.apache.org Tue Aug 12 13:08:06 2008 Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 99297 invoked from network); 12 Aug 2008 13:08:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Aug 2008 13:08:06 -0000 Received: (qmail 29464 invoked by uid 500); 12 Aug 2008 13:08:05 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 29199 invoked by uid 500); 12 Aug 2008 13:08:04 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@cocoon.apache.org List-Id: Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 29188 invoked by uid 99); 12 Aug 2008 13:08:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Aug 2008 06:08:04 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [88.198.46.98] (HELO indoqa.com) (88.198.46.98) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Aug 2008 13:07:06 +0000 Received: from [10.4.1.227] (unknown [86.59.20.138]) by indoqa.com (Postfix) with ESMTP id 308A2256114 for ; Tue, 12 Aug 2008 15:07:02 +0200 (CEST) Message-ID: <48A18AF2.70404@apache.org> Date: Tue, 12 Aug 2008 15:06:58 +0200 From: =?ISO-8859-2?Q?Reinhard_P=F6tz?= User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: dev@cocoon.apache.org Subject: Re: Cocoon Maven plug-in (RCL) and custom profiles References: <48A1849E.8080902@tuffmail.com> In-Reply-To: <48A1849E.8080902@tuffmail.com> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org Grzegorz Kossakowski wrote: > Hi, > > Our Maven plug-in which handles RAD of blocks has a concept of profiles. > In profile one can define default content of basic resources like > web.xml or applicationContext.xml for web application prepared by RCL > that will host developed block(s). > > The problem I have is that we have two profiles hardcoded right now: > * cocoon22 > * ssf > > The first one is rather obvious; the second one is meant for people > developing on top of SSF but not using Cocoon so web.xml does not > contain definitions of Cocoon-specific filters, etc. > > However, if you develop on top of Cocoon you still might need to > customize applicationContext.xml (e.g. configuration of Spring > Configurator) in order to run your block properly. Therefore, I see the > need for being able to define custom profiles. > > Why only wonders me is this snippet[1]: > // check profile > if ("cocoon-22".equals(this.webappProfile)) { > getLog().info("Preparing a Cocoon web application."); > } else if ("ssf".equals(this.webappProfile)) { > getLog().info("Preparing a Servlet-Service web application."); > } else { > throw new MojoExecutionException("Only the profiles > 'cocoon-22' and 'ssf' are supported."); > } > > It looks like these two profiles were intentionally hard-coded and > nothing else is allowed. Is there any reason for that? There hasn't been any alternative useful value so far. Actually it isn't done by just setting a profile parameter. The content also needs to be somewhere available. The code that you cited above is only a parameter value check to give feedback if the plugin parameter is valid. > If not, wouldn't anybody mind if I implemented the ability to define > custom profile and provide it as dependency for Cocoon Maven plug-in? Custom profiles are already supported but I admit that the naming is not consistent. You can use the customWebappDirectory configuration parameter and point to a directory that contains your custom webapp files. See http://cocoon.apache.org/2.2/maven-plugins/maven-plugin/1.0/prepare-mojo.html#customWebappDirectory -- Reinhard Pötz Managing Director, {Indoqa} GmbH http://www.indoqa.com/en/people/reinhard.poetz/ Member of the Apache Software Foundation Apache Cocoon Committer, PMC member reinhard@apache.org ________________________________________________________________________