public class BuildQualifierMojo extends AbstractVersionMojo
The generated qualifier is assigned to buildQualifier
project property. Unqualified
project version is assigned to unqualifiedVersion
project property. Unqualified
version is calculated based on ${project.version}
and can be used for any Tycho
project (eclipse-update-site, eclipse-application, etc) and regular maven project. Different
projects can use different formats to expand the timestamp, however (highly not recommended but
possible).
Starting with version 0.16, it is now possible to use custom build timestamp generation logic. The primary usecase is to generate build version qualifier based on the timestamp of the last project commit. Here is example pom.xml snippet that enables custom timestamp generation logic
... <plugin> <groupId>org.eclipse.tycho</groupId> <artifactId>tycho-packaging-plugin</artifactId> <version>${tycho-version}</version> <dependencies> <dependency> <groupId>timestamp-provider-groupid</groupId> <artifactId>timestamp-provider-artifactid</artifactId> <version>timestamp-provider-version</version> </dependency> </dependencies> <configuration> <timestampProvider>custom</timestampProvider> </configuration> </plugin> ...
Modifier and Type | Field and Description |
---|---|
protected File |
baseDir |
static String |
BUILD_QUALIFIER_PROPERTY |
protected BuildPropertiesParser |
buildPropertiesParser |
protected org.apache.maven.plugin.MojoExecution |
execution |
protected String |
forceContextQualifier |
protected SimpleDateFormat |
format
Specify a date format as specified by java.text.SimpleDateFormat.
|
protected org.apache.maven.execution.MavenSession |
session |
protected String |
timestampProvider
Role hint of a custom build timestamp provider.
|
protected Map<String,BuildTimestampProvider> |
timestampProviders |
static String |
UNQUALIFIED_VERSION_PROPERTY |
packaging, project, projectTypes
Constructor and Description |
---|
BuildQualifierMojo() |
Modifier and Type | Method and Description |
---|---|
void |
execute() |
protected Date |
getBuildTimestamp() |
void |
setFormat(String formatString) |
getOSGiId, getOSGiVersion
public static final String BUILD_QUALIFIER_PROPERTY
public static final String UNQUALIFIED_VERSION_PROPERTY
protected org.apache.maven.execution.MavenSession session
protected SimpleDateFormat format
protected File baseDir
protected String forceContextQualifier
protected String timestampProvider
protected org.apache.maven.plugin.MojoExecution execution
protected BuildPropertiesParser buildPropertiesParser
protected Map<String,BuildTimestampProvider> timestampProviders
public void setFormat(String formatString)
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
protected Date getBuildTimestamp() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
Copyright © 2008-2012 Eclipse Foundation. All Rights Reserved.