o Made goals on plugin-info.html appear in alphabetical order
git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/trunk@657609 13f79535-47bb-0310-9956-ffa450edef68master
parent
86aa89d224
commit
caffb8bef9
|
|
@ -21,7 +21,9 @@ package org.apache.maven.plugin.plugin;
|
|||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.ResourceBundle;
|
||||
|
|
@ -310,7 +312,10 @@ public class PluginReport
|
|||
tableHeader( new String[] { goalColumnName, descriptionColumnName } );
|
||||
}
|
||||
|
||||
for ( Iterator i = pluginDescriptor.getMojos().iterator(); i.hasNext(); )
|
||||
List mojos = new ArrayList();
|
||||
mojos.addAll( pluginDescriptor.getMojos() );
|
||||
PluginUtils.sortMojos( mojos );
|
||||
for ( Iterator i = mojos.iterator(); i.hasNext(); )
|
||||
{
|
||||
MojoDescriptor mojo = (MojoDescriptor) i.next();
|
||||
|
||||
|
|
|
|||
|
|
@ -25,8 +25,6 @@ import java.io.IOException;
|
|||
import java.io.StringReader;
|
||||
import java.io.Writer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
|
|
@ -372,17 +370,7 @@ public class PluginHelpGenerator
|
|||
}
|
||||
}
|
||||
|
||||
Collections.sort( mojoDescriptors, new Comparator()
|
||||
{
|
||||
|
||||
public int compare( Object arg0, Object arg1 )
|
||||
{
|
||||
MojoDescriptor mojo0 = (MojoDescriptor) arg0;
|
||||
MojoDescriptor mojo1 = (MojoDescriptor) arg1;
|
||||
return mojo0.getGoal().compareToIgnoreCase( mojo1.getGoal() );
|
||||
}
|
||||
|
||||
} );
|
||||
PluginUtils.sortMojos( mojoDescriptors );
|
||||
|
||||
writer.write( " /** {@inheritDoc} */" + LS );
|
||||
writer.write( " public void execute()" + LS );
|
||||
|
|
|
|||
|
|
@ -27,6 +27,8 @@ import java.net.MalformedURLException;
|
|||
import java.net.URL;
|
||||
import java.net.URLClassLoader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
|
@ -35,6 +37,7 @@ import java.util.regex.Pattern;
|
|||
|
||||
import org.apache.maven.artifact.DependencyResolutionRequiredException;
|
||||
import org.apache.maven.model.Dependency;
|
||||
import org.apache.maven.plugin.descriptor.MojoDescriptor;
|
||||
import org.apache.maven.plugin.descriptor.PluginDescriptor;
|
||||
import org.apache.maven.project.MavenProject;
|
||||
import org.apache.maven.reporting.MavenReport;
|
||||
|
|
@ -393,4 +396,27 @@ public final class PluginUtils
|
|||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sorts the specified mojo descriptors by goal name.
|
||||
*
|
||||
* @param mojoDescriptors The mojo descriptors to sort, may be <code>null</code>.
|
||||
*/
|
||||
public static void sortMojos( List mojoDescriptors )
|
||||
{
|
||||
if ( mojoDescriptors != null )
|
||||
{
|
||||
Collections.sort( mojoDescriptors, new Comparator()
|
||||
{
|
||||
|
||||
public int compare( Object arg0, Object arg1 )
|
||||
{
|
||||
MojoDescriptor mojo0 = (MojoDescriptor) arg0;
|
||||
MojoDescriptor mojo1 = (MojoDescriptor) arg1;
|
||||
return mojo0.getGoal().compareToIgnoreCase( mojo1.getGoal() );
|
||||
}
|
||||
|
||||
} );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue