1 package org.apache.maven.model.interpolation;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.util.Date;
23 import java.util.Properties;
24
25 import org.codehaus.plexus.interpolation.AbstractValueSource;
26
27 class BuildTimestampValueSource
28 extends AbstractValueSource
29 {
30 private final MavenBuildTimestamp mavenBuildTimestamp;
31
32 BuildTimestampValueSource( Date startTime, Properties properties )
33 {
34 super( false );
35 this.mavenBuildTimestamp = new MavenBuildTimestamp( startTime, properties );
36 }
37
38 @Override
39 public Object getValue( String expression )
40 {
41 if ( "build.timestamp".equals( expression ) || "maven.build.timestamp".equals( expression ) )
42 {
43 return mavenBuildTimestamp.formattedTimestamp();
44 }
45 return null;
46 }
47 }