Hi
I hacked Maven.java so that it outputs goals sorted in plugins, such as
[maven]
test
jar
The plugin name is what is before the ":", ie "maven:test", "maven:jar"
would give "maven" as the plugin.
[clover] : Generates the Clover report
A goal with the same name as
the plugin name, ie: "clover", will be shown with the plugin name.
It is considered the default one.
I'm documenting the goals, and adding default goals for the projects,
so that we can have the best overview of all the goals.
St�phane
Index: src/java/org/apache/maven/app/Maven.java
===================================================================
RCS file:
/home/cvspublic/jakarta-turbine-maven/src/java/org/apache/maven/app/Maven.java,v
retrieving revision 1.47
diff -u -r1.47 Maven.java
--- src/java/org/apache/maven/app/Maven.java 5 Jul 2002 22:52:05 -0000 1.47
+++ src/java/org/apache/maven/app/Maven.java 5 Jul 2002 23:33:39 -0000
@@ -673,10 +673,34 @@
boolean hadDesc = false;
boolean hasBlanks = false;
+
+ // sort by plugin
+ String lastPluginName = "";
+
while (goalIter.hasNext())
{
eachGoal = (Goal) goalIter.next();
description = eachGoal.getDescription();
+ String goalName = eachGoal.getName();
+
+ String pluginName = "";
+ boolean isMain = false;
+ boolean newPackage = false;
+
+ StringTokenizer st = new StringTokenizer(goalName, ":");
+ pluginName = st.nextToken();
+
+ if(pluginName.equals(goalName))
+ {
+ isMain = true;
+ newPackage = true;
+ }
+
+ if (!pluginName.equals(lastPluginName))
+ {
+ newPackage = true;
+ lastPluginName = pluginName;
+ }
if (description == null)
{
@@ -686,12 +710,32 @@
hadDesc = true;
- System.out.println(" "
- + format(eachGoal.getName()
- + " ",
- 30,
- '.')
- + " " + eachGoal.getDescription());
+ if(isMain && newPackage)
+ {
+ System.out.println("");
+ System.out.println("[" + pluginName + "] : " + description);
+ }
+ else if(newPackage)
+ {
+ System.out.println("");
+ System.out.println("[" + pluginName + "]");
+ String shortName = goalName.substring(pluginName.length() + 1,
+ goalName.length());
+ System.out.println(" " + format(shortName + " ", 30, '.')
+ + " " + description);
+ }
+ else if(isMain)
+ {
+ System.out.println("o " + format(goalName + " ", 30, '.')
+ + " " + description);
+ }
+ else
+ {
+ String shortName = goalName.substring(pluginName.length() + 1,
+ goalName.length());
+ System.out.println(" " + format(shortName + " ", 30, '.')
+ + " " + description);
+ }
}
if (hasBlanks)
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>