remove index.xml generation as that is in the plugin-plugin now

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@419153 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2006-07-05 03:50:11 +00:00
parent 73c7fc2309
commit f50b1a8db2
1 changed files with 0 additions and 158 deletions

View File

@ -40,8 +40,6 @@ public class PluginXdocGenerator
public void execute( File destinationDirectory, PluginDescriptor pluginDescriptor )
throws IOException
{
writeOverview( destinationDirectory, pluginDescriptor );
for ( Iterator it = pluginDescriptor.getMojos().iterator(); it.hasNext(); )
{
MojoDescriptor descriptor = (MojoDescriptor) it.next();
@ -72,162 +70,6 @@ public class PluginXdocGenerator
return mojo.getGoal() + "-mojo." + ext;
}
private void writeOverview( File destinationDirectory, PluginDescriptor pluginDescriptor )
throws IOException
{
FileWriter writer = null;
try
{
writer = new FileWriter( new File( destinationDirectory, "index.xml" ) );
writeOverview( writer, pluginDescriptor );
writer.flush();
}
finally
{
IOUtil.close( writer );
}
}
private void writeOverview( FileWriter writer, PluginDescriptor pluginDescriptor )
{
XMLWriter w = new PrettyPrintXMLWriter( writer );
w.startElement( "document" );
// ----------------------------------------------------------------------
//
// ----------------------------------------------------------------------
w.startElement( "properties" );
w.startElement( "title" );
// TODO: need a friendly name for a plugin
w.writeText( pluginDescriptor.getArtifactId() + " - Overview" );
w.endElement();
w.endElement();
// ----------------------------------------------------------------------
//
// ----------------------------------------------------------------------
w.startElement( "body" );
w.startElement( "section" );
// TODO: need a friendly name for a plugin
w.addAttribute( "name", pluginDescriptor.getArtifactId() );
// TODO: description of plugin, examples?
w.startElement( "p" );
w.writeText( "Goals available: " );
w.endElement();
writeGoalTable( pluginDescriptor, w );
w.endElement();
w.endElement();
}
private void writeGoalTable( PluginDescriptor pluginDescriptor, XMLWriter w )
{
w.startElement( "table" );
w.startElement( "tr" );
w.startElement( "th" );
w.writeText( "Goal" );
w.endElement();
w.startElement( "th" );
w.writeText( "Description" );
w.endElement();
w.endElement();
List mojos = pluginDescriptor.getMojos();
if ( mojos != null )
{
for ( Iterator i = mojos.iterator(); i.hasNext(); )
{
MojoDescriptor mojo = (MojoDescriptor) i.next();
w.startElement( "tr" );
// ----------------------------------------------------------------------
//
// ----------------------------------------------------------------------
w.startElement( "td" );
String paramName = mojo.getFullGoalName();
w.startElement( "a" );
w.addAttribute( "href", getMojoFilename( mojo, "html" ) );
w.startElement( "code" );
w.writeText( paramName );
w.endElement();
w.endElement();
w.endElement();
// ----------------------------------------------------------------------
//
// ----------------------------------------------------------------------
w.startElement( "td" );
if ( StringUtils.isNotEmpty( mojo.getDescription() ) )
{
w.writeMarkup( mojo.getDescription() );
}
else
{
w.writeText( "No description." );
}
String deprecationWarning = mojo.getDeprecated();
if ( deprecationWarning != null )
{
w.writeMarkup( "<br/><b>Deprecated:</b> " );
w.writeMarkup( deprecationWarning );
if ( deprecationWarning.length() == 0 )
{
w.writeText( "No reason given." );
}
w.endElement();
}
w.endElement();
w.endElement();
}
}
w.endElement();
w.endElement();
}
private void writeBody( FileWriter writer, MojoDescriptor mojoDescriptor )
{
XMLWriter w = new PrettyPrintXMLWriter( writer );