Skip to content

Commit

Permalink
[MPH-162] Allow all mojos to be configured to produce repeatable output
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-o committed Aug 14, 2022
1 parent 11e3270 commit e598bde
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import java.util.List;
import java.util.Map;

import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
Expand Down Expand Up @@ -67,11 +66,9 @@ public void execute()

if ( output != null )
{
String formattedDateTime = DateFormatUtils.ISO_8601_EXTENDED_DATETIME_TIME_ZONE_FORMAT
.format( System.currentTimeMillis() );
StringBuilder sb = new StringBuilder();
sb.append( "Created by: " ).append( getClass().getName() ).append( LS );
sb.append( "Created on: " ).append( formattedDateTime ).append( LS ).append( LS );
sb.append( "Generated by Maven Help Plugin" ).append( LS );
sb.append( "See: https://maven.apache.org/plugins/maven-help-plugin/" ).append( LS ).append( LS );
sb.append( message.toString() );

try
Expand Down
7 changes: 2 additions & 5 deletions src/main/java/org/apache/maven/plugins/help/SystemMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
* under the License.
*/

import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.Mojo;
import org.codehaus.plexus.util.StringUtils;
Expand Down Expand Up @@ -92,11 +91,9 @@ public void execute()

if ( output != null )
{
String formattedDateTime = DateFormatUtils.ISO_8601_EXTENDED_DATETIME_TIME_ZONE_FORMAT
.format( System.currentTimeMillis() );
StringBuilder sb = new StringBuilder();
sb.append( "Created by: " ).append( getClass().getName() ).append( LS );
sb.append( "Created on: " ).append( formattedDateTime ).append( LS ).append( LS );
sb.append( "Generated by Maven Help Plugin" ).append( LS );
sb.append( "See: https://maven.apache.org/plugins/maven-help-plugin/" ).append( LS ).append( LS );
sb.append( message.toString() );

try
Expand Down

0 comments on commit e598bde

Please sign in to comment.