Package org.codehaus.mojo.buildhelper
Class TimestampPropertyMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.codehaus.mojo.buildhelper.AbstractDefinePropertyMojo
org.codehaus.mojo.buildhelper.TimestampPropertyMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
@Mojo(name="timestamp-property",
defaultPhase=VALIDATE,
threadSafe=true)
public class TimestampPropertyMojo
extends AbstractDefinePropertyMojo
Sets a property based on the current date and time.
- Since:
- 1.7
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
The locale to use, for exampleen,US
.private org.apache.maven.execution.MavenSession
The Maven Session.private String
The property to set.private int
An offset to apply to the current time.private String
The date/time pattern to be used.private String
The source of the time.private String
The timezone to use for displaying time.private String
The unit of the offset to be applied to the current time.Fields inherited from class org.codehaus.mojo.buildhelper.AbstractDefinePropertyMojo
project
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.codehaus.mojo.buildhelper.AbstractDefinePropertyMojo
defineProperty, getProject
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
name
The property to set. -
pattern
The date/time pattern to be used. The values are as defined by the Java SimpleDateFormat class. -
timeZone
The timezone to use for displaying time. The values are as defined by the Java {$link TimeZone} class. -
offset
@Parameter(defaultValue="0") private int offsetAn offset to apply to the current time. -
unit
The unit of the offset to be applied to the current time. Valid Values are- millisecond
- second
- minute
- hour
- day
- week
- month
- year
-
timeSource
The source of the time. Valid Values are- current
- build
- Since:
- 3.2.0
-
locale
The locale to use, for exampleen,US
. -
mavenSession
@Parameter(readonly=true, defaultValue="${session}") private org.apache.maven.execution.MavenSession mavenSessionThe Maven Session.- Since:
- 3.2.0
-
-
Constructor Details
-
TimestampPropertyMojo
public TimestampPropertyMojo()
-
-
Method Details
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
-