You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by vs...@apache.org on 2008/08/05 14:19:00 UTC
svn commit: r682686 - in
/maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help:
AbstractHelpMojo.java DescribeMojo.java EffectivePomMojo.java SystemMojo.java
Author: vsiveton
Date: Tue Aug 5 05:18:59 2008
New Revision: 682686
URL: http://svn.apache.org/viewvc?rev=682686&view=rev
Log:
o using StringUtils.repeat() instead of long line
Modified:
maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/AbstractHelpMojo.java
maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/DescribeMojo.java
maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/EffectivePomMojo.java
maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/SystemMojo.java
Modified: maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/AbstractHelpMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/AbstractHelpMojo.java?rev=682686&r1=682685&r2=682686&view=diff
==============================================================================
--- maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/AbstractHelpMojo.java (original)
+++ maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/AbstractHelpMojo.java Tue Aug 5 05:18:59 2008
@@ -36,6 +36,9 @@
public abstract class AbstractHelpMojo
extends AbstractMojo
{
+ /** The maximum length of a display line. */
+ protected static final int LINE_LENGTH = 79;
+
/**
* Optional parameter to write the output of this help in a given file, instead of writing to the console.
* <br/>
Modified: maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/DescribeMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/DescribeMojo.java?rev=682686&r1=682685&r2=682686&view=diff
==============================================================================
--- maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/DescribeMojo.java (original)
+++ maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/DescribeMojo.java Tue Aug 5 05:18:59 2008
@@ -442,7 +442,7 @@
}
buffer.append( "Plugin: \'" ).append( name ).append( '\'' );
- buffer.append( "\n-----------------------------------------------" );
+ buffer.append( "\n" ).append( StringUtils.repeat( "-", LINE_LENGTH ) );
buffer.append( "\nGroup Id: " ).append( pd.getGroupId() );
buffer.append( "\nArtifact Id: " ).append( pd.getArtifactId() );
buffer.append( "\nVersion: " ).append( pd.getVersion() );
@@ -456,7 +456,7 @@
{
buffer.append( "\nMojos:\n" );
- String line = "\n===============================================";
+ String line = "\n" + StringUtils.repeat( "=", LINE_LENGTH );
for ( Iterator it = pd.getMojos().iterator(); it.hasNext(); )
{
@@ -538,7 +538,7 @@
*/
private void describeMojo( MojoDescriptor md, StringBuffer buffer )
{
- String line = "\n===============================================";
+ String line = "\n" + StringUtils.repeat( "=", LINE_LENGTH );
buffer.append( "Mojo: \'" ).append( md.getFullGoalName() ).append( '\'' );
buffer.append( line );
@@ -634,7 +634,7 @@
{
buffer.append( "\nComponent Requirements:\n" );
- String line = "\n-----------------------------------------------";
+ String line = "\n" + StringUtils.repeat( "=", LINE_LENGTH );
int idx = 0;
for ( Iterator it = reqs.iterator(); it.hasNext(); idx++ )
@@ -679,7 +679,7 @@
{
buffer.append( "\nParameters:" );
- String line = "\n-----------------------------------------------";
+ String line = "\n" + StringUtils.repeat( "=", LINE_LENGTH );
int idx = 0;
for ( Iterator it = params.iterator(); it.hasNext(); )
Modified: maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/EffectivePomMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/EffectivePomMojo.java?rev=682686&r1=682685&r2=682686&view=diff
==============================================================================
--- maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/EffectivePomMojo.java (original)
+++ maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/EffectivePomMojo.java Tue Aug 5 05:18:59 2008
@@ -23,6 +23,7 @@
import org.apache.maven.model.io.xpp3.MavenXpp3Writer;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.project.MavenProject;
+import org.codehaus.plexus.util.StringUtils;
import java.io.IOException;
import java.io.StringWriter;
@@ -77,13 +78,13 @@
getEffectivePom( project, message );
- message.append( "\n\n" );
+ message.append( "\n" );
}
}
else
{
getEffectivePom( project, message );
- message.append( "\n\n" );
+ message.append( "\n" );
}
if ( output != null )
@@ -142,12 +143,12 @@
{
pomWriter.write( sWriter, pom );
- message.append( "\n************************************************************************************" );
+ message.append( "\n" ).append( StringUtils.repeat( "=", LINE_LENGTH ) );
message.append( "\nEffective POM for project \'" + project.getId() + "\'" );
- message.append( "\n************************************************************************************" );
+ message.append( "\n" ).append( StringUtils.repeat( "=", LINE_LENGTH ) );
message.append( "\n" );
message.append( sWriter.toString() );
- message.append( "\n************************************************************************************" );
+ message.append( "\n" ).append( StringUtils.repeat( "=", LINE_LENGTH ) );
}
catch ( IOException e )
{
Modified: maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/SystemMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/SystemMojo.java?rev=682686&r1=682685&r2=682686&view=diff
==============================================================================
--- maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/SystemMojo.java (original)
+++ maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/SystemMojo.java Tue Aug 5 05:18:59 2008
@@ -25,6 +25,7 @@
import java.util.Properties;
import org.apache.maven.plugin.MojoExecutionException;
+import org.codehaus.plexus.util.StringUtils;
import org.codehaus.plexus.util.cli.CommandLineUtils;
/**
@@ -45,9 +46,17 @@
{
StringBuffer message = new StringBuffer();
- message.append( "===== Platform Details =====" ).append( '\n' );
message.append( '\n' );
- message.append( "===== System Properties =====" ).append( '\n' );
+ message.append( StringUtils.repeat( "=", LINE_LENGTH ) ).append( '\n' );
+ message.append( StringUtils.repeat( "=", 25 ) );
+ message.append( " Platform Properties Details " );
+ message.append( StringUtils.repeat( "=", 25 ) ).append( '\n' );
+ message.append( StringUtils.repeat( "=", LINE_LENGTH ) ).append( '\n' );
+ message.append( '\n' );
+
+ message.append( StringUtils.repeat( "=", LINE_LENGTH ) ).append( '\n' );
+ message.append( "System Properties" ).append( '\n' );
+ message.append( StringUtils.repeat( "=", LINE_LENGTH ) ).append( '\n' );
Properties systemProperties = System.getProperties();
for ( Iterator it = systemProperties.keySet().iterator(); it.hasNext(); )
@@ -58,7 +67,9 @@
}
message.append( '\n' ).append( '\n' );
- message.append( "===== Environment Variables =====" ).append( '\n' );
+ message.append( StringUtils.repeat( "=", LINE_LENGTH ) ).append( '\n' );
+ message.append( "Environment Variables" ).append( '\n' );
+ message.append( StringUtils.repeat( "=", LINE_LENGTH ) ).append( '\n' );
try
{
Properties envVars = CommandLineUtils.getSystemEnvVars();