1 package org.apache.maven.project.interpolation;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.text.SimpleDateFormat;
23 import java.util.Date;
24
25 import org.codehaus.plexus.interpolation.AbstractValueSource;
26
27
28
29
30
31 @Deprecated
32 public class BuildTimestampValueSource
33 extends AbstractValueSource
34 {
35
36 private final Date startTime;
37
38 private final String format;
39
40 private String formattedDate;
41
42 public BuildTimestampValueSource( Date startTime, String format )
43 {
44 super( false );
45 this.startTime = startTime;
46 this.format = format;
47 }
48
49 public Object getValue( String expression )
50 {
51 if ( "build.timestamp".equals( expression ) || "maven.build.timestamp".equals( expression ) )
52 {
53 if ( formattedDate == null && startTime != null )
54 {
55 formattedDate = new SimpleDateFormat( format ).format( startTime );
56 }
57
58 return formattedDate;
59 }
60
61 return null;
62 }
63
64 }