Questions tagged [maven-bom]

Maven BOM (bill of materials) is a pattern for collectively managing the versions of multiple dependencies into your project.

For Maven based project which have several artifacts which don't follow single versioning schema vendors may supply recommended dependency via prepared dependency file in dependencyManagement section.

Refer to official docs for example.

Common example of Maven BOM supplied by Spring project:

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-framework-bom</artifactId>
            <version>${spring.version}</version>
            <scope>import</scope>
            <type>pom</type>
        </dependency>
        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-releasetrain</artifactId>
            <version>${spring-data.version}</version>
            <scope>import</scope>
            <type>pom</type>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-bom</artifactId>
            <version>${spring-security.version}</version>
            <scope>import</scope>
            <type>pom</type>
        </dependency>
    </dependencies>
</dependencyManagement>
95 questions
32
votes
6 answers

How to find a Maven dependency version declaration imported from a BOM

A multi-module parent POM declares the following BOM import: io.spring.platform platform-bom
Marcel Stör
  • 22,695
  • 19
  • 92
  • 198
18
votes
2 answers

How to override the version numbers from Spring Boot when importing a BOM pom?

How do I override the version numbers being imported by Spring Boot, without manually setting each artifact in the dependency management section? 1.5.7.RELEASE
Sled
  • 18,541
  • 27
  • 119
  • 168
18
votes
3 answers

Does Maven have a way to get a dependency version as a property?

I'm using a BOM to import dependencies from another project to mine, and I need a way to reference a dependency's version that is already declared in said BOM. So far, I've attempted to list the dependency version as a property in the BOM, but this…
josh-cain
  • 4,997
  • 7
  • 35
  • 55
15
votes
3 answers

How do I use a maven BOM (bill of materials) to manage my dependencies in SBT?

I want to use an external BOM to manage dependency versions for my project in SBT. For example, the AWS Java SDK publishes a bill-of-materials artifact to their maven repository:…
kiiadi
  • 381
  • 2
  • 7
14
votes
4 answers

Can I create a Maven POM-only (BOM) build using the Gradle maven plugin to be deployed to Nexus?

I have a Gradle project which uses Spring's dependency management plugin to define a list of dependency versions. I am also using the Maven plugin to deploy the project to a Maven repository. I would like to be able to deploy this as a Maven bill…
M. Justin
  • 14,487
  • 7
  • 91
  • 130
13
votes
1 answer

Gradle 7.0 Version Catalog for maven bom

I have published maven bom and imported it in top level build.gradle.kts as: allProjects { dependencies { implementation(platform("com.example:some-dependencies:1.2.3")) } } And then in libs.versions.toml: [libraries] some-bom = {…
Hiosdra
  • 332
  • 3
  • 11
12
votes
2 answers

Publish a bom from a multi-module-project

We are a large company with about 2000 separate Java projects. For historic reasons, we do not have multi-module projects, but we would like to introduce them. Logically, we already have "groups" of projects, i.e. someone responsible for (say) 50…
J Fabian Meier
  • 33,516
  • 10
  • 64
  • 142
10
votes
1 answer

Using Gradle 5.1 "implementation platform" instead of Spring Dependency Management Plugin

I have written a Gradle Plugin that contains a bunch of common setup configuration so that all of our projects just need to apply that plugin and a set of dependencies. It uses the Spring Dependency Management Plugin to setup the BOM imports for…
Shane Rowatt
  • 1,951
  • 3
  • 27
  • 44
9
votes
1 answer

Unable to use Maven BOM in gradle 5 with annotationProcessor configuration

I am trying to use maven BOM with gradle 5.1.1 as mentioned below ext { set('spring-boot-dependencies.version', '2.1.2.RELEASE') } apply plugin: 'java' group 'com.acme' version '1.0.0-SNAPSHOT' sourceCompatibility = 1.8 repositories { …
Ashok Koyi
  • 5,327
  • 8
  • 41
  • 50
9
votes
2 answers

How to use JUnit 5.2 BOM in Maven dependency?

According to the newly released v. 5.2 of JUnit, there is now a BOM: JUnit BOM: To ease dependency management using Maven or Gradle, a Bill of Materials POM is now provided under the org.junit:junit-bom:5.2.0 Maven coordinates. As a starting…
Vankog
  • 557
  • 1
  • 9
  • 16
8
votes
2 answers

Which Maven BOM determines a dependency's version in Gradle 5?

I am currently developing a Gradle 5 project that imports two different Maven BOMs. Therefore, I use the native Gradle syntax without the dependency management plugin. However, both BOMs may define different versions for the same…
8
votes
1 answer

Is it good practice to define scope of dependencies in Maven BOM (bill of materials)?

I have a pom.xml like this to be used as a BOM (Bill of Materials). One of the defined dependencies is a *-test artifact used for testing your code that uses the libraries from this BOM. The question is: is it appropriate / good practice to specify…
Adam Hošek
  • 794
  • 7
  • 10
6
votes
3 answers

Gradle: Access version declaration in spring boot dependency-management plugin

I have spring boot project and I try to use spring boot dependency-management plugin to be able to use provided dependency versions. The plugin 'simulates' mavens BOM behaviour, which means that it somehow retrieves versions of libs from maven…
Sasha Shpota
  • 9,436
  • 14
  • 75
  • 148
5
votes
1 answer

Maven parent POM vs BOM dependency management

Let's say I have a maven parent POM root which defines foo:bar:1.0.0 in dependency management. I have another parent POM parent which uses root as parent (just to add another layer to the example). Lastly I have a bill of materials bom which uses…
Garret Wilson
  • 18,219
  • 30
  • 144
  • 272
5
votes
2 answers

How to use newer version of a library with Spring Boot

I am developing an application using Spring Boot 1.5.9.RELEASE, and I am using Gradle as build tool. I want to use SelenumHQ 3.8.1 in the project. When I was building the project I noticed that Selenium 2.53.1 was added to project (not 3.8.1), so I…
Amir Pashazadeh
  • 7,170
  • 3
  • 39
  • 69
1
2 3 4 5 6 7