Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Section
titleAdding Unique Snapshot Versions

To use Unique Snapshot Versions you need to replace the version in snapshot build with a formatted timestamp for the version specified in the atlassian-plugin.xml.

Code Block
languagexml
titleSpecify version in the atlassian-plugin.xml
<version>${project.atlassian.plugin.version}</version>

Per default, that is on every build that is not a release build, the property is set with the version information.

Code Block
languagexml
titleProperty definition in pom.xml
<project.atlassian.plugin.version>$version>
  ${build.version.major}.${build.version.minor}.${build.version.micro}-${build.timestamp.custom}
</project.atlassian.plugin.version>

The properties shown above are provided by the Buildmetadata Maven Plugin (please use version 1.7.0 or later). You may use other tools. What is important that the property you specified in the atlassian-plugin.xml is provided by the build process.

In case of a release build, the version provided by the POM should be set. Otherwise the administrator could not easily determine, if the app is in a released or snapshot version.

Specify a profile you activate with the Maven Release Plugin.

Code Block
languagexml
titleProfile definition in pom.xml
<profile>
  <id>release-doctype-add-on</id>
  <properties>
    <project.atlassian.plugin.version>${project.version}</project.atlassian.plugin.version>
  </properties>
</profile>

This seems simple, but the only why we accomplished that for version 2.5.3 is using the arguments parameter.

Code Block
languagexml
titleMaven Release Plugin configuration in pom.xml
<pluginManagement>
  <plugins>
    ...
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-release-plugin</artifactId>
      <version>2.5.3</version>
      <configuration>
        <useReleaseProfile>false</useReleaseProfile>
        <arguments>-P release-doctype-add-on</arguments>
      </configuration>
    </plugin>
    ...
  </plugins>
</pluginManagement>

...