Full name:

com.smartcodeltd:release-candidate-maven-plugin:1.0-201910011043.383523b:version

Description:

Retrieves project version specified in pom.xml and outputs it either to stdout or to a file, depending on configuration.

Attributes:

  • Requires a Maven project to be executed.
  • Executes as an aggregator plugin.
  • The goal is thread-safe and supports parallel builds.
  • Binds by default to the lifecycle phase: package.

Optional Parameters

Name Type Since Description
encoding String - Encoding used when reading from and writing to files on disk.
Default value is: UTF-8.
outputTemplate String -

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.


Default value is: {{ version }}.
User property is: outputTemplate.
outputUri URI -

Defines where to direct the output of release-candidate:version

  • Setting outputUri to stdout will print output to the console,
  • using file://${project.basedir}/project.properties will direct the output to a project.properties file for example.

Please note that you should use an absolute path when specifying the outputUri. You can get hold of your project base directory by using ${project.basedir} as per the example above.


Default value is: stdout.
User property is: outputUri.

Parameter Details

encoding:

Encoding used when reading from and writing to files on disk.
  • Type: java.lang.String
  • Required: No
  • Default: UTF-8

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.

  • Type: java.lang.String
  • Required: No
  • User Property: outputTemplate
  • Default: {{ version }}

outputUri:

Defines where to direct the output of release-candidate:version

  • Setting outputUri to stdout will print output to the console,
  • using file://${project.basedir}/project.properties will direct the output to a project.properties file for example.

Please note that you should use an absolute path when specifying the outputUri. You can get hold of your project base directory by using ${project.basedir} as per the example above.

  • Type: java.net.URI
  • Required: No
  • User Property: outputUri
  • Default: stdout

Back to top

Version: 1.0-201910011043.383523b. Last Published: 2019-10-01.