Well,

I have implemented this functionality and it's works.

So if you want to add folders that should be restricted (use sources from here but not generate files) you need to do following steps.

1) Patch generama sources and build generama-1.2.1-SNAPSHOT (See patch in GRA-3 ticket)
2) Fix your plugin shouldGenerate() method. Add
        if (!super.shouldGenerate(metadata))
            return false;
on the top of method.

3) Add following property to project.properties
     maven.xdoclet.0.<your_plugin>.restrictedPath=${your_path}, {another_path}
   Configure Ant script will be also supereasy. Just remember the property name: 'restrictedPath'

Thats all.
Run maven xdoclet2 and you see that mapping does not generated from restrictedPath.

On 9/6/05, Anatol Pomozov <[EMAIL PROTECTED]> wrote:
Hi, xdoclet devs.

I have some ideas about restricted source directory.

Well I am start from my requirement:
I have 2 project modules, for example myproject-base and myproject-web

myproject-base contains base classes and other common stuff. It contains BasePersistenseObject

class BasePersistenseObject {
  /** @hibernate.property type="string" column="col1" .... */
  getCreateAt()

  // Other 20 properties...
}

BasePersistenseObject have a lot of xdoclet stuff.

myproject-web module have classes that extend BasePersistenseObject i.e.

/** @hibernate.class */
class User extends BasePersistenseObject {
  /** @hibernate.property type="string" column="col1" .... */
   getUserName();
}

I want to generate hibernate mappings for mappings that are in myweb module. Because I want that User get all xdoclet stuff
from BasePersistenseObject I need to attach sources of base module to xdoclet task. So I add <path-to-myproject-base-module> to
maven.xdoclet.0.fileset.0.dir property.

Well now xdoclet generates User with 'createdAt' property as needed but it is also generates mappings for a lot of classes that are located in
base project. I don't want it.

There is my solution: add to plugin (probably in xdoclet or generama) property restrictedDirs that is list of pathes.
In shouldGenerate() method we check if generated file located in any directory from this list then skip generation.

What do you think. Have you any suggestions? If you have no any objections then I start to implement this functionality.
--
anatol



--
anatol

Reply via email to