[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xml-cocoon-dev
Subject:    Re: Cocoon 2.2 - Build and deployment with Maven2
From:       Reinhard Poetz <reinhard () apache ! org>
Date:       2005-12-13 8:09:03
Message-ID: 439E819F.3010605 () apache ! org
[Download RAW message or body]

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
--------------------------------------------------------------------
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic