|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.maven.plugin.AbstractMojo
com.smartcodeltd.ReleaseCandidateMojo
com.smartcodeltd.VersionMojo
@Mojo(name="version",
requiresProject=true,
defaultPhase=PACKAGE)
public class VersionMojo
Retrieves project version specified in pom.xml and outputs it
either to stdout or to a file, depending on configuration.
| Field Summary | |
|---|---|
protected String |
outputTemplate
Defines how to structure the output of release-candidate:version |
| Fields inherited from class com.smartcodeltd.ReleaseCandidateMojo |
|---|
charset, encoding, project |
| Fields inherited from interface org.apache.maven.plugin.Mojo |
|---|
ROLE |
| Constructor Summary | |
|---|---|
VersionMojo()
|
|
| Method Summary | |
|---|---|
void |
execute()
|
| Methods inherited from class com.smartcodeltd.ReleaseCandidateMojo |
|---|
getOrElse, info, parsed, versionOf, with |
| Methods inherited from class org.apache.maven.plugin.AbstractMojo |
|---|
getLog, getPluginContext, setLog, setPluginContext |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
@Parameter(defaultValue="{{ version }}",
required=false,
property="outputTemplate")
protected String outputTemplate
Defines how to structure the output of release-candidate:version
If your build server of choice understands text output produced by maven (which is the case if you're using
TeamCity for example), you can specify the outputTemplate as:
<outputTemplate>
##teamcity[setParameter name='env.PROJECT_VERSION' value='{{ version }}']
##teamcity[message text='Project version: {{ version }}']
</outputTemplate>
If your build server prefers to use env variables defined using property files (Jenkins with EnvInject plugin)
you can specify the outputTemplate as:
<outputTemplate>PROJECT_VERSION={{ version }}</outputTemplate>
Please note that when using multi-line templates, leading whitespace characters will be stripped.
| Constructor Detail |
|---|
public VersionMojo()
| Method Detail |
|---|
public void execute()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||