retrofit
retrofit copied to clipboard
Publish a BOM
What kind of issue is this?
-
[ ] Question. This issue tracker is not the place for questions. If you want to ask how to do something, or to understand why something isn't working the way you expect it to, use Stack Overflow. https://stackoverflow.com/questions/tagged/retrofit
-
[ ] Bug report. If you’ve found a bug, spend the time to write a failing test. Bugs with tests get fixed. Here’s an example: https://gist.github.com/swankjesse/6608b4713ad80988cdc9
-
[x] Feature Request. Start by telling us what problem you’re trying to solve. Often a solution already exists! Don’t send pull requests to implement new features without first getting our support. Sometimes we leave features out on purpose to keep the project small.
Hey there! Love the project, but I would love it if there was a BOM file that is published for each version. If you're not familiar with a BOM,it stands for "Bill of Materials" it helps your Gradle (in my case, but it's originally a Maven thing) file look like this:
implementation(platform("com.squareup.retrofit2:retrofit-bom:2.6.1") )
implementation("com.squareup.retrofit2:retrofit")
implementation("com.squareup.retrofit2:converter-jackson")
Instead of this:
val retrofitVersion by extra { "2.6.1" }
implementation("com.squareup.retrofit2:retrofit:$retrofitVersion")
implementation("com.squareup.retrofit2:converter-jackson:$retrofitVersion")
Notice how you just leave the versions off when you use a BOM. This can help reduce the number of dependency compatibility surprises one can encounter, especially if a transitive dependency brings in a newer version of one of the components (it'll be reduced to the BOM's version).
Here's a deeper dive into how a BOM works:
https://howtodoinjava.com/maven/maven-bom-bill-of-materials-dependency/
Just a friendly reminder that according to https://github.com/square/retrofit/pull/2944, BoM was wating for Gradle conversion. Now that the Gradle conversion is done, I'd love for a platform/BoM project to be published.
Could possibly be as easy as:
plugins {
`java-platform`
}
dependencies {
constraints {
rootProject.subprojects.onEach {
api("${it.group}:${it.name}:$version")
}
}
}
PR welcome!