GeezerVison is showing github.com — Provide a bill of materials (BOM) · Issue #2321 · mockito/mockito
Provide a bill of materials (BOM) #2321DescriptionI figured that the number of Mockito artifacts grows, so it might be useful to provide a BOM (Bill Of Materials) that lists all versions of all artifacts in a central place.
Such a thing could then be consumed in a Gradle multi project build through
// my.platform.project:test
plugins {
id("java-platform")
}
dependencies {
api(platform("org.mockito:mockito-bom:$someVersion"))
}
and this could be referenced in individual module files like so:
dependencies {
testImplementation(platform("my.platform.project:test"))
testImplementation("org.mockito:mockito-core")
testImplementation("org.mockito:mockito-junit-jupiter")
}
Creating and publishing such a BOM should be fairly easy. Thanks! Reacted by Semyon Levin, René Kraneis, Björn Michael and MatPag Activityrealdadfish commented on Jun 10, 2021 ContributorAuthor More actions TimvdLippe commented on Jun 10, 2021 I am not intimately familiar with a BOM file, but if it is relatively easy to generate and helps users in certain situations, I guess we could. Could you submit a PR? realdadfish commented on Jun 11, 2021 ContributorAuthor More actions I can easily come up with an automated way of creating such a BOM based on the current Gradle configuration, however I'm not familiar with the background of the mentioned side projects. If the BOM could / should list more than Mockito's very own artifacts for compatibility reasons, one would go down a different route and compile the BOM differently. Or would you say that if we start with Mockito's own artifacts this would suffice all users (again, I'm not aware of compatibility issues between the aforementioned subprojects, but of course there could be some). TimvdLippe commented on Jun 11, 2021 The side projects have a different release cadence and version scheme, so I don't think we should include these in the mockito-core BOM. The artifacts that are versioned together are:
mockito-core
mockito-inline
mockito-android
mockito-junit-jupiter
mockito-errorprone
realdadfish commented on Jun 11, 2021 ContributorAuthor More actions Ok, understood. I just asked because all of these projects themselves depend on a specific version of "mockito-core", so if they're used in conjunction with plain Mockito dependencies from the BOM, they render the version pinning aspect of it kind of useless. E.g. a user that creates a dependency graph like this
testImplementation(platform("org.mockito:mockito-bom:3.11"))
testImplementation("org.mockito:mockito-core")
testImplementation("org.mockito:mockito-kotlin:<some-version>")
would get it's "mockito-core" dependency silently overridden by "mockito-kotlin" if this specifies another (higher) version of "mockito-core", unless the user specifies
testImplementation(enforcedPlatform("org.mockito:mockito-bom:3.11"))
instead, which would downgrade whatever "mockito-kotlin" would depend on, eventually introducing compatibility issues / bugs.
But anyways, I'd follow your lead here, I just wanted to make clear what I meant :) TimvdLippe commented on Jun 11, 2021 Ah I see. Yes mockito-kotlin is free to use its own versioning scheme, so we can't guarantee they would use the same version.
Does that mean the value proposition of a BOM file is low and maybe therefore not worth doing? 😢 pzygielo commented on Jun 11, 2021
Does that mean the value proposition of a BOM file is low and maybe therefore not worth doing?
As the user - I'd like to use BOM to manage listed modules sharing release lifecycle, in one import in maven project.
I can't offer help to actually do it, but should it exist - I'm sure plenty of projects would benefit from it. realdadfish commented on Jun 11, 2021 ContributorAuthor More actions
Does that mean the value proposition of a BOM file is low and maybe therefore not worth doing?
Well, one can obviously already start with it anyways. If more modules are added in the future, the situation for users will only get better. And maybe one day the other projects will chime in as well and have their versions fixed in cadence of the "mothership" project, so I'd probably still do it. TimvdLippe commented on Jun 11, 2021 Okay, that sounds good to me. I am happy to review a PR that introduces a BOM file for the artifacts listed in #2321 (comment) added 2 commits that reference this issue on Jun 11, 2021This issue will close once commit e88cb29 is merged into the 'main' branch.e88cb29 This issue will close once commit 7b5d9e8 is merged into the 'main' branch.7b5d9e8 realdadfish commented on Jun 11, 2021 ContributorAuthor More actions Done, this is what it looks like:
Details
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>org.mockito</groupId>
<artifactId>mockito-bom</artifactId>
<version>3.11.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>mockito-bom</name>
<description>Mockito Bill of Materials (BOM)</description>
<url>https://github.com/mockito/mockito</url>
<licenses>
<license>
<name>The MIT License</name>
<url>https://github.com/mockito/mockito/blob/main/LICENSE</url>
<distribution>repo</distribution>
</license>
</licenses>
<developers>
<developer>
<id>mockitoguy</id>
<name>Szczepan Faber</name>
<url>https://github.com/mockitoguy</url>
<roles>
<role>Core developer</role>
</roles>
</developer>
<developer>
<id>bric3</id>
<name>Brice Dutheil</name>
<url>https://github.com/bric3</url>
<roles>
<role>Core developer</role>
</roles>
</developer>
<developer>
<id>raphw</id>
<name>Rafael Winterhalter</name>
<url>https://github.com/raphw</url>
<roles>
<role>Core developer</role>
</roles>
</developer>
<developer>
<id>TimvdLippe</id>
<name>Tim van der Lippe</name>
<url>https://github.com/TimvdLippe</url>
<roles>
<role>Core developer</role>
</roles>
</developer>
</developers>
<scm>
<url>https://github.com/mockito/mockito.git</url>
</scm>
<issueManagement>
<system>GitHub issues</system>
<url>https://github.com/mockito/mockito/issues</url>
</issueManagement>
<ciManagement>
<system>GH Actions</system>
<url>https://github.com/mockito/mockito/actions</url>
</ciManagement>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-android</artifactId>
<version>3.11.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-errorprone</artifactId>
<version>3.11.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-inline</artifactId>
<version>3.11.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>3.11.1-SNAPSHOT</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
added a commit that references this issue on Jun 11, 2021This issue will close once commit bc05a68 is merged into the 'main' branch.bc05a68 added a commit that references this issue on Dec 28, 2021This issue will close once commit dc88436 is merged into the 'main' branch.dc88436 TimvdLippe commented on Jan 24, 2022 Reacted by temp-droid Reacted by temp-droid pzygielo commented on Jan 24, 2022 Confused, #2321 (comment)
- mockito-core
- mockito-inline
- mockito-android
- mockito-junit-jupiter
- mockito-errorprone
but there is unlisted earlier
Is mockito-core not managed intentionally? Reacted by Semyon Levin, Falko Modler, Björn Michael and Stefano Cordio TimvdLippe commented on Jan 24, 2022 @realdadfish probably knows best, but if we were to add mockito-core to the BOM, I think we would have to add api(project.rootProject) to
famod commented on Jan 24, 2022 Just wanted to switch to the new BOM in Quarkus and was equally confused by missing mockito-core. TimvdLippe commented on Jan 24, 2022 I think that makes sense and we can publish a patch release to include it. Can anybody send us a PR with the fix (most likely the fix in #2321 (comment) should work) and verify that indeed fixes the issue? TimvdLippe commented on Jan 25, 2022 Reacted by Semyon Levin, Falko Modler and Piotrek Żygieło added a commit that references this issue on Sep 29, 2024This issue will close once commit d894b54 is merged into the 'main' branch.d894b54
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|