A maven plugin that can create Bitbucket tags
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
travis
.editorconfig
.gitattributes
.gitignore
.travis.yml
LICENSE
README.md
pom.xml

README.md

yak4j-bitbucket-maven-plugin

A Maven plugin that can create Bitbucket tags.

Build Status Maven Central Coverage Status

Maven

<plugin>
  <groupId>com.github.ngeor</groupId>
  <artifactId>yak4j-bitbucket-maven-plugin</artifactId>
  <version>0.4.3</version>
</plugin>

Goals

Important: The git tag is prefixed by the letter v.

  • The ensure-tag-does-not-exist goal will break the build if a git tag that matches the pom version already exists.

  • The publish-tag goal will publish a new git tag.

Common Configuration Parameters

  • username and password are the credentials for the Bitbucket Cloud REST API
  • owner and slug identify the git repository
  • hash points to the current git SHA

ensure-tag-does-not-exist

This goal runs at the VALIDATE phase by default. It will fail the build if the version defined in the pom.xml:

  • is not a valid semantic version
  • would leave a gap in the semver sequence, based on the biggest git tag

Example: if the biggest git tag is v1.2.3, then the build will fail, unless the pom version is one of 1.2.4, 1.3.0, 2.0.0.

This goal will ignore snapshot versions.

publish-tag

This goal runs at the DEPLOY phase by default. It publishes a tag in git using the Bitbucket Cloud REST API. The tag is named after the pom version, prefixed with the letter v.

This goal will fail if the version in pom.xml is a snapshot version.

Configuration Example

<profiles>
  <profile>
    <id>ci-only</id>
    <activation>
      <property>
        <name>env.CI</name>
        <value>true</value>
      </property>
    </activation>
    <build>
      <plugins>
        <plugin>
          <groupId>com.github.ngeor</groupId>
          <artifactId>yak4j-bitbucket-maven-plugin</artifactId>
          <version>0.4.0</version>
          <executions>
            <execution>
              <id>ensure-tag-does-not-exist</id>
              <goals>
                <goal>ensure-tag-does-not-exist</goal>
              </goals>
            </execution>
            <execution>
              <id>publish-tag</id>
              <goals>
                <goal>publish-tag</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <username>${env.BITBUCKET_USERNAME}</username>
            <password>${env.BITBUCKET_PASSWORD}</password>
            <owner>${env.BITBUCKET_REPO_OWNER}</owner>
            <slug>${env.BITBUCKET_REPO_SLUG}</slug>
            <hash>${env.BITBUCKET_COMMIT}</hash>
          </configuration>
        </plugin>
      </plugins>
    </build>
  </profile>
</profiles>