The Multi Module Maven Release Plugin

A maven release plugin built for multi-maven-module git repositories allowing continuous deployment

License

License

Categories

Categories

Maven Build Tools
GroupId

GroupId

de.hilling.maven.release
ArtifactId

ArtifactId

smart-release-plugin
Last Version

Last Version

4.1
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

The Multi Module Maven Release Plugin
A maven release plugin built for multi-maven-module git repositories allowing continuous deployment
Project URL

Project URL

https://github.com/guhilling/smart-release-plugin
Source Code Management

Source Code Management

https://github.com/guhilling/smart-release-plugin

Download smart-release-plugin

How to add to project

<plugin>
    <groupId>de.hilling.maven.release</groupId>
    <artifactId>smart-release-plugin</artifactId>
    <version>4.1</version>
</plugin>

Dependencies

compile (14)

Group / Artifact Type Version
com.jcraft : jsch.agentproxy.sshagent jar 0.0.9
com.jcraft : jsch.agentproxy.core jar 0.0.9
com.jcraft : jsch.agentproxy.jsch jar 0.0.9
com.jcraft : jsch.agentproxy.usocket-nc jar 0.0.9
com.google.code.gson : gson jar 2.8.0
commons-io : commons-io jar 2.5
org.apache.maven : maven-plugin-api jar 2.2.1
org.apache.maven : maven-model jar 2.2.1
org.apache.maven : maven-project jar 2.2.1
org.apache.maven : maven-settings jar 2.2.1
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.3
org.eclipse.jgit : org.eclipse.jgit jar 4.6.1.201703071140-r
com.jcraft : jsch jar 0.1.53
org.codehaus.plexus : plexus-utils jar 1.5.15

provided (3)

Group / Artifact Type Version
org.immutables : value jar 2.4.4
org.immutables : serial jar 2.4.4
com.google.code.findbugs : jsr305 jar 3.0.0

runtime (2)

Group / Artifact Type Version
org.immutables : gson jar 2.4.4
org.slf4j : slf4j-simple jar 1.7.21

test (7)

Group / Artifact Type Version
commons-lang : commons-lang jar 2.6
org.apache.commons : commons-exec jar 1.3
org.apache.maven.shared : maven-invoker jar 2.2
org.hamcrest : hamcrest-core jar 1.3
org.hamcrest : hamcrest-library jar 1.3
junit : junit jar 4.12
org.mockito : mockito-core jar 2.0.2-beta

Project Modules

There are no modules declared in this project.

Documentation, download, and usage instructions

Automatically releases only changed modules of a multi-module maven project.

Full documentation is available here as maven site documentation.

The project was started as a fork of Daniel Flowers multi-module-maven-release-plugin with with the goal to create bugfix releases automatically (See documentation).

Development

Build Status Coverage Status Maven Central

Features

  • Automatically releases only changed modules of a multi-module maven project.
    • Dependencies are automatically resolved transitively.
    • Version numbers must follow format -SNAPSHOT.
    • Minor and bugfix numbers are chosen automatically.
    • Regular releases increase the minor number in the resulting artifacts.
    • Bugfix releases increase the bugfix number relative to the latest regular release.
  • Allows to create bugfix-releases in bugfix branches.
    • Use flag -DperformBugfixRelease to trigger bugfix.
  • Tracks the released versions robust and efficient in release-files.
  • The actual release creation is up to the user (See [Quick start]).

Quick Start

Most important: You have to use git as version control system. Support for other VCS is not yet planned.

Configuration of the plugin

Add the plugin to your pom:

    <build>
        <plugins>
            <plugin>
                <groupId>de.hilling.maven.release</groupId>
                <artifactId>smart-release-plugin</artifactId>
                <version>4.0</version>
            </plugin>
        </plugins>
    </build>

Release

To run the release, use mvn smart-release:prepare. This will execute the following steps:

  • Sanity checks:
    • Local Repository clean?
    • Version numbers follow the required scheme?
    • No SNAPSHOT-dependencies except the local ones?
  • Version management:
    • All changes relative to the latest tag are computed. The latest tag is stored in the release-info.json file. If this file is missing the plugin assumes that all modules are released for the first time.
    • All modules that have changes relative to their latest release (that is stored in release-info.json) are prepared for release by setting their minor number to the next minor release number in their pom.xml. The same is done for all modules that have transitive dependencies on these modules. The plugin prints out which modules will be released and why. The release-info.json file is commited an tagged. It is not pushed. It is up to you, when you want to push the file and the corresponding tag.
    • All modules that are not released will not be changed.
  • A list of modules to build is stored in modules-to-build.txt. The content can be fed directly to the maven -pl (project list) option
  • A list of files that need to be reverted later is stored in files-to-revert.txt. The cleanup goal can be used to actual revert.
  • You do a maven run to build an deploy the modules that have changed. Usually you would run:
   mvn -pl $(cat modules-to-build.txt) clean deploy
  • If the deploy-stage was successful you should push the updated release-info.json and the corresponding tag:
    • This should actually be performed automatically by jenkins or whatever ci-System you are using to perform your releases. You are using a ci-System, aren't you?.
    • Of course the details of the git setup are up to you. It is actually one of the advantages of this plugin that it only does one thing and lets you configure how to handle the rest.
   git push && git push --tags

Versions

Version
4.1
4.0
3.9
3.8
3.7
3.3
3.2
3.1
3.0