Class CreateTimestampMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.codehaus.mojo.build.CreateTimestampMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
@Mojo(name="create-timestamp",
defaultPhase=INITIALIZE,
requiresProject=true,
threadSafe=true)
public class CreateTimestampMojo
extends org.apache.maven.plugin.AbstractMojo
This mojo is designed to give you a timestamp available through one or more properties. Only a single timestamp is
created for each execution of the mojo. This timestamp can be format into one or more strings which are then saved to
properties.
create a timestamp property
- Since:
- 1.0-beta-5
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanExecute this only once in root project of a multi module build.private org.apache.maven.execution.MavenSessionThe maven session.private booleanWhether to skip this execution.private StringApply this java.text.SimpleDateFormat to the timestamp.private StringYou can rename the timestamp property name to another property name if desired.private StringThe timezone of the generated timestamp.Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
skip
@Parameter(property="maven.buildNumber.skip", defaultValue="false") private boolean skipWhether to skip this execution.- Since:
- 1.3
-
session
@Parameter(defaultValue="${session}", required=true, readonly=true) private org.apache.maven.execution.MavenSession sessionThe maven session. -
timestampPropertyName
@Parameter(property="maven.buildNumber.timestampPropertyName", defaultValue="timestamp") private String timestampPropertyNameYou can rename the timestamp property name to another property name if desired. -
timestampFormat
@Parameter(property="maven.buildNumber.timestampFormat", defaultValue="") private String timestampFormatApply this java.text.SimpleDateFormat to the timestamp. By default, no formatting is done but the raw number value (milliseconds since January 1, 1970, 00:00:00 GMT) is used. -
timezone
The timezone of the generated timestamp. If blank will default toTimeZone.getDefault() -
executeRootOnly
@Parameter(defaultValue="false") private boolean executeRootOnlyExecute this only once in root project of a multi module build.
-
-
Constructor Details
-
CreateTimestampMojo
public CreateTimestampMojo()
-
-
Method Details
-
execute
public void execute()
-