* @return an array of java class
*/
@SuppressWarnings( "unchecked" )
protected JavaClass[] discoverClasses( final PluginToolsRequest request )
{
JavaDocBuilder builder = new JavaDocBuilder();
builder.setEncoding( request.getEncoding() );
MavenProject project = request.getProject();
for ( String source : (List<String>) project.getCompileSourceRoots() )
{
builder.addSourceTree( new File( source ) );
}
// TODO be more dynamic
File generatedPlugin = new File( project.getBasedir(), "target/generated-sources/plugin" );
if ( !project.getCompileSourceRoots().contains( generatedPlugin.getAbsolutePath() ) )
{
builder.addSourceTree( generatedPlugin );
}
return builder.getClasses();
}