Fix: mng2562 - timestamp

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@695241 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Britton Isbell 2008-09-14 15:36:56 +00:00
parent 6221dfb9e6
commit 180bf37d84
2 changed files with 20 additions and 13 deletions

View File

@ -49,14 +49,8 @@ import org.codehaus.plexus.logging.console.ConsoleLogger;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.*;
import java.text.SimpleDateFormat;
public class DefaultBuildExtensionScanner
implements BuildExtensionScanner, LogEnabled
@ -163,11 +157,20 @@ public class DefaultBuildExtensionScanner
config.setExecutionProperties( execProps );
//INTERPOLATION
List<InterpolatorProperty> interpolatorProperties = new ArrayList<InterpolatorProperty>();
interpolatorProperties.addAll( InterpolatorProperty.toInterpolatorProperties( config.getExecutionProperties(),
PomInterpolatorTag.SYSTEM_PROPERTIES.name()));
interpolatorProperties.addAll( InterpolatorProperty.toInterpolatorProperties( config.getUserProperties(),
PomInterpolatorTag.USER_PROPERTIES.name()));
if(config.getBuildStartTime() != null)
{
interpolatorProperties.add(new InterpolatorProperty("${build.timestamp}",
new SimpleDateFormat("yyyyMMdd-hhmm").format( config.getBuildStartTime() ),
PomInterpolatorTag.PROJECT_PROPERTIES.name()));
}
model = PomClassicTransformer.interpolateModel( model, interpolatorProperties, modelPom.getParentFile());
grabManagedPluginsWithExtensionsFlagTurnedOn( model, managedPluginsWithExtensionsFlag );

View File

@ -64,11 +64,8 @@ import java.io.Reader;
import java.io.StringReader;
import java.io.Writer;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.text.SimpleDateFormat;
/**
@ -538,6 +535,13 @@ public class DefaultMavenProjectBuilder
interpolatorProperties.addAll( InterpolatorProperty.toInterpolatorProperties( config.getUserProperties(),
PomInterpolatorTag.USER_PROPERTIES.name()));
if(config.getBuildStartTime() != null)
{
interpolatorProperties.add(new InterpolatorProperty("${build.timestamp}",
new SimpleDateFormat("yyyyMMdd-hhmm").format( config.getBuildStartTime() ),
PomInterpolatorTag.PROJECT_PROPERTIES.name()));
}
MavenProject mavenProject;
try
{