Hi,

I've come up against a problem whilst developing an ejb code generation plugin.

outline of what the plugin does
1) generates all ejb sources from a single ejb java file (remote, home, local, localHome, descriptors etc).
2) These sources are placed in target/ejbgen
3) target/ejbgen dir added to maven.compile.src.set
4) ejb plugin called to assemble the ejb-jar


The problems come when I want to make use of other plugins e.g. javadoc, checkstyle, jalopy (OK, checkstyle and jalopy aren't relevant for generated code but they illustrate a wider problem).

These plugins typically work using maven.build.sourceDirectory. The result is that the generated sources aren't included in the execution of other plugins.

A workaround for me is to generate all the sources into the pom.build.sourceDirectory and exclude them from cvs via .cvsignore. I don't like this as this breaks the rule of /src for sources /target for generated, compiled and assembled. clean would no longer would delete my generated sources.

It feels to me that this sort of problem is likely to occur in other situations, particularly as the amount of generated code in projects increases.

I remember from a while ago there were lengthy debates about the pros / cons of having multiple source directories (primarily to support existing non-maven project structures). I think the result was to support only one java source directory to encourage people porting projects to break them into their constituent sub-projects. Another route for multiple source directories appeared with maven.compile.src.set (thankfully for my plugin).

IMO there should be a recomendation that plugins that operate on java sources should work from the same sources (either pom.build.sourceDirectory or maven.compile.src.set) maven.compile.src.set gets my vote.

cheers
Nathan


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to