By default (or maybe it is by design) the XDoclet plugin wants it
generated output to go in "target/generated-sources/xdoclet" and it
AUTOMATICALLY adds this path to the source directory list.  It is bad
practice to have XDoclet (or any other code generator) place its output
under "src".  In NetBeans, the NetBeans plugin creates a separate source
tree entry for the generated sources; I would think that the Eclipse
plugin does the same (or it should if it doesn't).

If you put the generated output where it belongs (in "target", not in
"src"), the problems you detailed will disappear, I believe.

-----Original Message-----
From: Peschier J. (Jeroen) [mailto:[EMAIL PROTECTED] 
Sent: Monday, January 16, 2006 07:25
To: Maven Users List
Subject: RE: Using multiple source directories to produce on artefact



I agree that a "mavenized" build probably does not need multiple source
dirs. However, for most of us Maven is not the only tool we use. My
use-case for multiple source dirs is to separate XDoclet-generated code.
The Maven build will indeed perform fine with the generated source in
the same directory as the main sources, but consider what happens
outside Maven:

(1) In Eclipse you get everything in a single source dir creating a huge
tree in the Package Explorer. I know it's possible to filter out the
generated source packages but it's not practical unless the
maven-eclipse-plugin facilitates this by excluding them from the view
for me.
(2) When using SCM within Eclipse: because everything is in a single
source dir you need to tell Eclipse (for ALL AND EVERY generated
package) you want the generated sources excluded from SCM. Again, very
impractical. Unless the maven-eclipse-plugin can exclude generated
sources from SCM I want it in a separate directory. This separate
directory can conveniently be excluded from SCM with a single ignore
entry.


Although I have things working like I want using the
build-helper-maven-plugin I'd still like to be able to set multiple
source dirs in the POM as it is much cleaner. I really don't see the
argument against multiple source dirs in the POM either. True
best-practices evangelists can still continue to use (and preach :)
single source directory projects. Nothing is lost with multiple source
dirs, it's just convenience that is gained.


-----Oorspronkelijk bericht-----
Van: dan tran [mailto:[EMAIL PROTECTED] 
Verzonden: donderdag 12 januari 2006 17:23
Aan: Maven Users List; [EMAIL PROTECTED]
Onderwerp: Re: Using multiple source directories to produce on artefact

Yes, build-helper is there for legacy build.  However, if a build is
completely
"mavenized", I see no need to have more than one primary source trees
and
adding a generated source tree the project , shoud be done by the
generated
source plugin
itself.

For now, i dont see a way out until at least 2.1, if it supports
multiple
main source trees ;-)

-D



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


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

Reply via email to