bom-search-maven-plugin Maven Plugin

Maven plugin to suggest which BOM artifact to use based on project dependencies.

Лицензия

Лицензия

MIT
Категории

Категории

Maven Компиляция и сборка Search Прикладные библиотеки
Группа

Группа

com.github.olegzzz
Идентификатор

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

bom-search-maven-plugin
Последняя версия

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

1.5
Дата

Дата

Тип

Тип

maven-plugin
Описание

Описание

bom-search-maven-plugin Maven Plugin
Maven plugin to suggest which BOM artifact to use based on project dependencies.
Ссылка на сайт

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

https://github.com/olegzzz/bom-search-maven-plugin
Система контроля версий

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

https://github.com/olegzzz/bom-search-maven-plugin

Скачать bom-search-maven-plugin

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

<plugin>
    <groupId>com.github.olegzzz</groupId>
    <artifactId>bom-search-maven-plugin</artifactId>
    <version>1.5</version>
</plugin>

Зависимости

compile (4)

Идентификатор библиотеки Тип Версия
ch.qos.logback : logback-classic jar 1.1.7
javax.inject : javax.inject jar 1
org.jsoup : jsoup jar 1.13.1
org.apache.maven.shared : maven-shared-incremental jar 1.1

provided (4)

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

test (4)

Идентификатор библиотеки Тип Версия
org.apache.maven : maven-compat jar 3.6.0
org.apache.maven.plugin-testing : maven-plugin-testing-harness jar 3.3.0
org.mockito : mockito-core jar 3.6.28
junit : junit jar 4.13.1

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

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

BOM search maven plugin

Master Status CodeQL Maven Central License: MIT

Plugin to lookup bill of materials (BOM) artifacts to retrofit existing project.

Motivation

Oftentimes a project of decent size contains multiple dependencies that share the same group. More often than not those dependencies managed via a common version hardcoded into project properties. Sometimes dependency management is used. In any case, it would greatly simplify dependency management if one single BOM file can be referenced to make sure all related dependencies have specific versions.

Here is a problem: with a lot of dependencies in the pom-file it's hard to figure out if any two or more share same group or if BOM available for those groups.

This plugin tries to do just that: given the project pom to lookup possible BOM artifacts for a group of dependencies.

Configuration

Goals

search runs a search for available BOM artifacts for current project.

enforce fails the build if it finds BOM artifacts available for current project but not used.

Settings

Name Type Description
<minOccurrence> int Minimal number of dependencies that share a group to search for BOM for that group.
User property: bomsearch.minOccurrence
Default value: 2
<mavenRepoUrl> URL Maven repository URL.
User property: bomsearch.mavenRepoUrl
Default value: https://repo.maven.apache.org/maven2
<incremental> boolean Use results from previous run if possible.
User property: bomsearch.incremental
Default value: true
<lenient> boolean If set to true, enforce goal will not fail the build, but still logs warnings.
User property: bomsearch.lenient
Default value: false
<skip> boolean Disable plugin.
User property: bomsearch.skip
Default value: false

Usage

Add to <build> section of the pom-file:

<plugin>
    <groupId>com.github.olegzzz</groupId>
    <artifactId>bom-search-maven-plugin</artifactId>
    <version>1.5</version>
    <executions>
        <execution>
            <id>default-cli</id>
            <goals>
                <goal>enforce</goal>
            </goals>
        </execution>
    </executions>
</plugin>

and run mvn verify

Build log will contain warnings with suggested BOM dependencies to include into the project. Let's say a project has multiple dropwizard dependencies, then looking into the log one can pick suggested BOM file (io.dropwizard:dropwizard-bom in this case):

[INFO] --- bom-search-maven-plugin:1.5:enforce (default-cli) ---
[INFO] Following BOMs found for module: [io.dropwizard:dropwizard-bom]
[WARNING] Following BOMs available but not used: [io.dropwizard:dropwizard-bom]

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

Версия
1.5
1.4
1.3
1.2
1.1
1.0