[ http://jira.codehaus.org/browse/MJAVADOC-61?page=comments#action_63286 ] 

Jukka Raanamo commented on MJAVADOC-61:
---------------------------------------

I ran into the same problem. To fix it, you'll need to insert javadoc plugin 
into the build lifecycle at such point where any additional compile source 
roots have already been added to the project. 

E.g.:

<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <executions>
          <execution>
            <phase>process-sources</phase>
            <goals>
              <goal>javadoc</goal>
            </goals>
           </execution>
        </executions>
  </plugin>


<plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <phase>generate-sources</phase>
            <configuration>
              <sourceRoot>${project.build.directory}/generated/java</sourceRoot>
              <tasks>
              ... some ant tasks
              </tasks>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

Here javadoc plugin is invoked after antrun plugin and therefore given 
sourceRoot is added to projects compile source roots. This may not be the right 
way to do it but that's how I got it working. Also notice that your code 
generator must be run from a plugin that adds the compile source root into the 
project like antrun does. Hope this is of any help. 

> Adding custom source paths to javadoc
> -------------------------------------
>
>          Key: MJAVADOC-61
>          URL: http://jira.codehaus.org/browse/MJAVADOC-61
>      Project: Maven 2.x Javadoc Plugin
>         Type: New Feature

>     Versions: 2.0-beta-3
>  Environment: FedoreCore 4 kernel 2.6.10-1.760_FC3smp #1
>     Reporter: Erik van Zijst

>
>
> I have a code generator that creates sources during the compile stage. These 
> sources end up in a custom directory 
> (${project.build.directory}/generated-sources/main/java). The problem is that 
> javadoc skips these files when it generates the documentation. What I'm 
> looking for is a way to manipulate javadoc's sourcefilenames argument.
> I have already tried adding 
> <sourceRoot>${project.build.directory}/generated-sources/main/java</sourceRoot>
>  to the code generation step, but it didn't affect javadoc.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to