You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2015/10/24 00:08:08 UTC
svn commit: r1710283 -
/maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/AbstractEffectiveMojo.java
Author: michaelo
Date: Fri Oct 23 22:08:08 2015
New Revision: 1710283
URL: http://svn.apache.org/viewvc?rev=1710283&view=rev
Log:
[MPH-108] Patch for MPH-72 not fully applied
Modified:
maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/AbstractEffectiveMojo.java
Modified: maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/AbstractEffectiveMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/AbstractEffectiveMojo.java?rev=1710283&r1=1710282&r2=1710283&view=diff
==============================================================================
--- maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/AbstractEffectiveMojo.java (original)
+++ maven/plugins/trunk/maven-help-plugin/src/main/java/org/apache/maven/plugins/help/AbstractEffectiveMojo.java Fri Oct 23 22:08:08 2015
@@ -24,17 +24,15 @@ import java.io.IOException;
import java.io.StringReader;
import java.io.StringWriter;
import java.io.Writer;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
-import java.util.Date;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Properties;
import java.util.Set;
+import org.apache.commons.lang3.time.DateFormatUtils;
import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.util.StringUtils;
import org.codehaus.plexus.util.WriterFactory;
@@ -51,7 +49,7 @@ import org.jdom.output.XMLOutputter;
/**
* Base class with common utilities to write effective Pom/settings.
- *
+ *
* @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
* @version $Id$
* @since 2.1
@@ -67,7 +65,7 @@ public abstract class AbstractEffectiveM
/**
* Utility method to write an XML content in a given file.
- *
+ *
* @param output is the wanted output file.
* @param content contains the XML content to be written to the file.
* @param encoding is the wanted encoding to use when writing file.
@@ -107,18 +105,16 @@ public abstract class AbstractEffectiveM
/**
* Write comments in the Effective POM/settings header.
- *
+ *
* @param writer not null
*/
protected static void writeHeader( XMLWriter writer )
{
XmlWriterUtil.writeCommentLineBreak( writer );
XmlWriterUtil.writeComment( writer, " " );
- // Use ISO8601-format for date and time
- DateFormat dateFormat = new SimpleDateFormat( "yyyy-MM-dd'T'hh:mm:ss" );
- XmlWriterUtil.writeComment( writer,
- "Generated by Maven Help Plugin on "
- + dateFormat.format( new Date( System.currentTimeMillis() ) ) );
+ // Use ISO 8601 format for date and time
+ String formattedDateTime = DateFormatUtils.ISO_DATETIME_FORMAT.format( System.currentTimeMillis() );
+ XmlWriterUtil.writeComment( writer, "Generated by Maven Help Plugin on " + formattedDateTime );
XmlWriterUtil.writeComment( writer, "See: http://maven.apache.org/plugins/maven-help-plugin/" );
XmlWriterUtil.writeComment( writer, " " );
XmlWriterUtil.writeCommentLineBreak( writer );
@@ -128,7 +124,7 @@ public abstract class AbstractEffectiveM
/**
* Write comments in a normalize way.
- *
+ *
* @param writer not null
* @param comment not null
*/
@@ -145,7 +141,7 @@ public abstract class AbstractEffectiveM
/**
* Add a Pom/Settings namespaces to the effective XML content.
- *
+ *
* @param effectiveXml not null the effective POM or Settings
* @param isPom if <code>true</code> add the Pom xsd url, otherwise add the settings xsd url.
* @return the content of the root element, i.e. <project/> or <settings/> with the Maven namespace or