cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reinhard Poetz <reinh...@apache.org>
Subject Re: Cocoon 2.2 - Build and deployment with Maven2
Date Tue, 13 Dec 2005 08:09:03 GMT
Reinhard Poetz wrote:

> A second thought: As outlined in one of my previous mails, a Cocoon 
> block will become a valid jar file, for example with following content:
> 
> ROOT
>  +-- block.xml
>  +-- pom.xml
>  +-- sitemap.xmap
>  +-- org
>   |  +--myProject
>   |     +-- MyJavaflowController.class
>   +-- app
>       +-- formTemplate.jx
>       +-- image.gif
>       +-- formDefinition.xml
> 
> At deployment this file is extracted into e.g. /WEB-INF/blocks/0000001. 
> I wonder if this can cause problems as a lot of resources become part of 
> the classpath but only MyJavaflowController.class should be.
> 
> If it is a problem we could provide two artifacts, one JAR file 
> containing the classes and one that contains the resources which is 
> extracted into /WEB-INF/blocks/0000001 but not added to the classpath. 
> ... but this makes the build and the deployment more complicated for our 
> users ...

I skyped with Jorg about this and we found a (possible) solution. When a block
is created, it should get following structure in our opinion:

ROOT
  +-- org
  |   +-- myProject
  |       +-- MyJavaFlowController.class
  +-- META-INF
  |   +-- org
  |       +-- myProject
  |           +-- pom.xml
  |           +-- block.xml
  +-- COCOON-APP
      +-- sitemap.xmap
      +-- formTemplate.jx
      +-- ...


This way, the only "used namespace" is COCOON-APP and if necessary we may find
some way to make the resources under it invisible for the classloader.

AFAWU it should be straight forward package the blocks as Maven provides more 
than one option to solve this.

                                       - o -

We also discussed the structure of projects as proposed by Jorg some time ago
(http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=113102875010469&w=2).

/my-block
      pom.xml
      /api
         pom.xml
      /impl
         pom.xml
      /samples
         pom.xml

The (usual) dependencies are:

  - impl depends on api (normal JAR dependency)
  - the sample block depends on the impl block

Out of this we will get two blocks:

  - my-block-block
  - my-block-samples-block


... which can be used by the block deployer.

-- 
Reinhard Pötz           Independent Consultant, Trainer & (IT)-Coach 

{Software Engineering, Open Source, Web Applications, Apache Cocoon}

                                        web(log): http://www.poetz.cc
--------------------------------------------------------------------

Mime
View raw message