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                  [EMAIL PROTECTED]
________________________________________________________________________

Reply via email to