Selective Build Maven Plugin (maven-plugin)

This plugin allows to build only submodules that contain changes. For bigger monorepo project this might speed the build speed dramatically.

Лицензия

Лицензия

Категории

Категории

Maven Компиляция и сборка
Группа

Группа

eu.lundegaard.maven
Идентификатор

Идентификатор

selective-build-maven-plugin
Последняя версия

Последняя версия

0.7.0
Дата

Дата

Тип

Тип

maven-plugin
Описание

Описание

Selective Build Maven Plugin (maven-plugin)
This plugin allows to build only submodules that contain changes. For bigger monorepo project this might speed the build speed dramatically.
Ссылка на сайт

Ссылка на сайт

https://github.com/lundegaard/selective-build-maven-plugin
Организация-разработчик

Организация-разработчик

Lundegaard a.s.
Система контроля версий

Система контроля версий

https://github.com/lundegaard/selective-build-maven-plugin/tree/master

Скачать selective-build-maven-plugin

Как подключить последнюю версию

<plugin>
    <groupId>eu.lundegaard.maven</groupId>
    <artifactId>selective-build-maven-plugin</artifactId>
    <version>0.7.0</version>
</plugin>

Зависимости

compile (3)

Идентификатор библиотеки Тип Версия
commons-io : commons-io jar 2.6
org.apache.maven : maven-plugin-api jar 3.6.1
org.slf4j : slf4j-api jar 1.7.26

provided (1)

Идентификатор библиотеки Тип Версия
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.6.0

Модули Проекта

Данный проект не имеет модулей.

Selective Build Maven Plugin

Selective Build Maven Plugin allows you to build and process only modules with changes in it. It is dependent on git client installed on your system.

Goal changes

This goal is used for selective builds (build only modules with changes).

It is used in three steps:

  1. Configure the plugin in the root POM
  2. Run the plugin and put the result into a environment variable
  3. Run standard maven build with options from the variable

Root POM setup

To use this plugin first you should set it up in the root POM like this.

<project>
    ...
    <build>
        ...
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>eu.lundegaard.maven</groupId>
                    <artifactId>selective-build-maven-plugin</artifactId>
                    <version>0.5.0</version>
                </plugin>
            </plugins>
        </pluginManagement>
        ...
    </build>
    ...
</project>

Get params for the build

The changes plugin outputs on stdout parameters for the onward build. These parameters are based on current git status and can result into one of the following states:

  1. Non-recursive build (build only root project) -- This happens mainly when there are no changes detected
  2. Selective build (build only changed modules)
  3. Full rebuild -- this happens when there are too much commits or when special files are changed

To obtain params one usually runs something like this:

MVN_RUN_OPTS=$(mvn -q -N selective-build:changes -Dsource=1234567890ABCDEF -Dtarget=FEDCBA0987654321)

The source and target properties are either commits or branches between which the changes are detected.

Run selective Maven build

To run the selective build afterwards is simple. Just run something like this:

mvn $MVN_RUN_OPTS clean verify 
eu.lundegaard.maven

Lundegaard a.s.

Версии библиотеки

Версия
0.7.0