On Tue, 24 Aug 2004, Rick Wayne wrote:
What do you Cocoon mavens consider to be the canonical practice for automatically building a deployable Cocoon application? In the past, I usually download a distribution, build it excluding as many blocks as I can stand, and then hand-edit things from there -- the sitemap, cocoon.xconf, the directories for my own stylesheets, JSPs, and XML, etc..
As we develop our Cocoon applications using Maven, we've created a Maven-Plugin that delivers a jar file that can be executed to install the containing Cocoon application into a prebuild Cocoon. The prebuild Cocoon is considered the Application Infrastructur (as we have several independent Cocoon applications running in one Cocoon instance). The main class in that jar file is responsible for applying patches to the various config files (cocoon.xconf, logkit.xconf, etc.). So in the end the deployment is just running
java -jar mycapp.jar path/to/cocoon/webapp
on the target machine. We had to do it that way as there usually isn't any Ant/Maven build tools available on the production servers.
A independent Cocoon application is build from
- the java classes your application needs (logic parts, just as an
usual project has)
- the Cocoon application files (sitemap, xslt, flows, forms, yada yada)
- patches to the various config files as for:
- component deployment into cocoon.xconf
- logging configuration for the components
- web.xml twiddling (i.e. authentication stuff)The patch part is more or less identical to the way the XConfToolTask does
its job (in fact it is a fork of it stripped down to eliminate all external dependencies).
So far we've never had the time to contribute this plugin as Maven isn't the official build tool Cocoon is using and we also never considered to rewrite it as an Ant task. We've contributed a script to tears apart the standard Cocoon build process into artifacts usable by the way Maven is managing dependencies (tools/bin/create-repository-jars.sh).
Some things that I know I'm doing wrong:
1) The process isn't at all automated, and can't be reliably regenerated from scratch.
With our Cocoon Maven plugin it is automated not only for the build process but also for the final deployment into a prebuild Cocoon somewhere.
2) I should be putting my application in a sub-sitemap and mounting it rather than editing the main sitemap -- yes?
Absolutetly, this is by far the easiest way.
So how do I best dovetail my stuff in with the C2 distribution so that it only takes one invocation -- either build.sh or ant -- to build it? I don't think I should try to build my stuff as a block; if nothing else, then I have to chuck the whole Cocoon distro into my CVS server. Maybe disk space is cheap, but is there a better way?
Thanks (as always) for your time.
-- Giacomo Pati Otego AG, Switzerland - http://www.otego.com Orixo, the XML business alliance - http://www.orixo.com
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
