Class ReleaseDraftMojo

All Implemented Interfaces:
org.apache.maven.api.plugin.Mojo
Direct Known Subclasses:
ReleasePublishMojo

@Mojo(name="release-draft", projectRequired=false, aggregator=true) public class ReleaseDraftMojo extends AbstractGoalMojo
Full release: build, deploy, tag, merge, and bump to next SNAPSHOT.

This goal automates the complete release workflow in one command. All local git work completes before any external action, so a deploy failure leaves the local repository in a consistent state and the deploy can be retried manually.

Local phase (idempotent):

  1. Validate prerequisites (branch, clean worktree)
  2. Create release/<version> branch
  3. Set POM version to release version
  4. Build and verify
  5. Build site (pre-flight — catches javadoc errors early)
  6. Commit, tag
  7. Restore ${project.version}, merge to main
  8. Bump to next SNAPSHOT version, verify, install, commit

The post-bump build runs install (not just verify) so the new -SNAPSHOT artifacts land in the local repository. For a self-hosting repo whose POM pins ike-maven-plugin to ${project.version}, this means the next ike:* invocation — including an ike:release-cascade walk to the next member — resolves the plugin without a manual install. IKE-Network/ike-issues#486.

External phase (most reversible first, irreversible last):

  1. Deploy site from tagged commit (overwritable — safe to retry)
  2. Deploy artifacts from tagged commit — to Maven Central via JReleaser when ike.publishToCentral is set, else to the internal Nexus (irreversible — last)
  3. Push tag and main to origin
  4. Create GitHub Release

By default this goal runs as a draft preview. Use ike:release-publish to execute the release, or pass -Dpublish=true explicitly.

Usage: mvn ike:release (preview), mvn ike:release-publish (execute), or override version with mvn ike:release-publish -DreleaseVersion=2

  • Constructor Details

    • ReleaseDraftMojo

      public ReleaseDraftMojo()
      Creates this goal instance.
  • Method Details

    • runGoal

      protected GoalReportSpec runGoal() throws org.apache.maven.api.plugin.MojoException
      Specified by:
      runGoal in class AbstractGoalMojo
      Throws:
      org.apache.maven.api.plugin.MojoException