Reinhard Pötz pisze:
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.

Actually now content is read from classpath, right? I think it should stay the same for any other custom profiles.

My idea is that it's an artifact that stores profile resources and Cocoon Maven plug-in simply depends on it. The configuration would look like:

      <plugin>
        <groupId>org.apache.cocoon</groupId>
        <artifactId>cocoon-maven-plugin</artifactId>
        <version>1.0.0-M3</version>
        <dependencies>
          <dependency>
            <groupId>org.custom</groupId>
            <artifactId>custom-profile</artifactId>
            <version>1.0.0</version>
          </dependency>
        </dependencies>
      </plugin>

Then, if I'm correct, Maven would attach this artifact to the classpath when executing Cocoon Maven plug-in so existing code reading profile resource would remain the same, right?

The code that you cited above is only a parameter value check to give feedback if the plugin parameter is valid.

That's true.

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

Thanks for pointing me to this setting. It turned out to be useful but there is one problem with this approach. The directory containing webapp resources is just simple directory in filesystem which would be in most cases placed outside the project that depends on it. The problem is that then this directory is not versioned from project's point of view. When you point project to custom webapp directory you pass no information about a version that you are interested in.

That's why I think that packaging this custom profile as a Maven artifact which is versioned and can be referenced form whatever project needs it makes more sense.

WDYT?

--
Grzegorz Kossakowski

Reply via email to