Hi, I agree - lots of source generation tooling generates to target/generated-sources ...
This has the advantage that the normal "clean" operation removes these. Using m2eclipse Eclipse plugin for maven - by default it will "miss" these generated directories the first time you import a project as a Maven project. However, the recovery is simple, and only needs doing once: right click the project and select Maven -> update project configuration. -Marshall On 10/21/2010 2:30 AM, Richard Matthias Eckart de Castilho wrote: > Hello Philip, > >> So, I would much rather have the generated >> code put into a different source folder that has only generated code in >> it. Something like src/generated/java or src/output/java or whatever >> the convention is. My question is whether or not there is a convention >> and if so could someone point me to a project that does something like this? > > my understanding is that target/generated-sources/<toolname> is appropriate - > I've seen this in a couple of instances. This is also what is mentioned in > the NetBeans wiki on Maven best practices: > >> If your project contains generated source roots that need to appear in the >> project's source path, please make sure that the Maven plugin generating the >> sources generates them in the target/generated-sources/<toolname> directory >> where <toolname> is folder specific to the Maven plugin used and acts as >> source root for the generated sources. Most common maven plugins currently >> follow this pattern in the default configuration. > (Source: http://wiki.netbeans.org/MavenBestPractices#Open_existing_project) > > There is also a Maven plugin which allows to add folders to the Maven source > folders list. This may help if e.g. Eclipse does not properly pick up the > folder: > > http://mojo.codehaus.org/build-helper-maven-plugin/usage.html > > Cheers, > > Richard >
