Hello !

I am currently building a Mojo, that creates an architecture description for
a tool (SonarJ) by analyzing dependencies in a multi-module pom. Here is a
simplified version of it:

/** * Create SonarJ Architecture Description from POM *  * @goal
generate-description * @aggregator * @execute phase="generate-sources" */
public class ArchitectureDescriptionMojo extends AbstractMojo implements
IValidationResult {    /**     * @parameter
default-value="${executedProject}"     * @readOnly     */    private
MavenProject project;

    public void execute() throws MojoExecutionException,
MojoFailureException    {
        List<MavenProject> modules = (List<MavenProject>)
project.getCollectedProjects();
        for (MavenProject module : modules)        {
            getLog().info(³Project ³+module.getArtifactId());
                       for (String dir : (List<String>)
module.getCompileSourceRoots())
            {
                getLog().info(³  dir: ³+dir);
            }        }     } }



Since the Mojo states, that the generate-sources phase should be executed
before, I was hoping that the list of compile source roots would include the
directories of generated sources, but it does not!! I can confirm that the
generated-sources phase is actually executed for each child module. After
spending a day trying all kind of things I now hope, that somebody out there
knows how to get a complete list of compile source roots for all child
modules including generated source directories.

This is my environment:

mvn --version
Apache Maven 2.1.0 (r755702; 2009-03-18 15:10:27-0400)
Java version: 1.6.0_15
Java home: /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home
Default locale: en_US, platform encoding: MacRoman
OS name: "mac os x" version: "10.5.8" arch: "x86_64" Family: "mac"

Thanks for any hint in advance.

Best regards  

Alexander von Zitzewitz

Reply via email to