Declare dependency versions inline instead of in our parent pom.#6659
Open
copybara-service[bot] wants to merge 1 commit intomasterfrom
Open
Declare dependency versions inline instead of in our parent pom.#6659copybara-service[bot] wants to merge 1 commit intomasterfrom
copybara-service[bot] wants to merge 1 commit intomasterfrom
Conversation
Fixes #6654, I hope? If `guava` and its parent pom don't refer to `mockito-core`, then `guava` should no longer affect which version of `mockito-core` is selected by Gradle. (Really, it "shouldn't" even now, but there's a mismatch between Maven's model and Gradle's that causes it to do so.) As part of resolving a merge conflict in the `android` flavor, I also noticed that I had never added a direct `checker-qual` dependency to that flavor's `guava-testlib` or `guava-tests` configuration, as I should have done back in cl/522315614 or thereabouts. So I added it. (Of course, it matters little because Maven lets us use the `checker-qual` dependency of `guava` transitively.) It would be nice if we could still declare our dependency versions only once, now by using `properties`. (In fact, my attempt to use `properties` made me notice that our version of the Error Prone _plugin_ is older than our version of the Error Prone _annotations_.) However, if we were to make that change, then we'd lose the ability to update dependencies with `versions-maven-plugin` (`update-properties` + `use-latest-releases`), I assume because the properties are declared in one `pom.xml` and used in another. (It's possible that Dependabot is better about this, but we've had trouble getting it to work with our unusual 2-flavor, Google-repo-source-of-truth setup.) Tested: ``` $ mvn dependency:tree -Dverbose -X -U &> /tmp/pre # made changes $ mvn dependency:tree -Dverbose -X -U &> /tmp/post $ strip() { cat "$@" | grep -v -e 'Dependency collection stats' -e 'Downloading from' -e 'Progress' -e 'Using connector' -e 'Using transporter' -e 'Using mirror' -e maven-dependency-plugin -e SUCCESS -e 'Total time' -e 'Finished at' | sed -e 's/ (.*managed from.*)//'; }; vimdiff <(strip /tmp/pre) <(strip /tmp/post) ``` RELNOTES=Changed our Maven project to avoid [affecting which version of Mockito our Gradle users see](#6654). PiperOrigin-RevId: 552479838
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Declare dependency versions inline instead of in our parent pom.
Fixes #6654, I hope? If
guavaand its parent pom don't refer tomockito-core, thenguavashould no longer affect which version ofmockito-coreis selected by Gradle. (Really, it "shouldn't" even now, but there's a mismatch between Maven's model and Gradle's that causes it to do so.)As part of resolving a merge conflict in the
androidflavor, I also noticed that I had never added a directchecker-qualdependency to that flavor'sguava-testliborguava-testsconfiguration, as I should have done back in cl/522315614 or thereabouts. So I added it. (Of course, it matters little because Maven lets us use thechecker-qualdependency ofguavatransitively.)It would be nice if we could still declare our dependency versions only once, now by using
properties. (In fact, my attempt to usepropertiesmade me notice that our version of the Error Prone plugin is older than our version of the Error Prone annotations.) However, if we were to make that change, then we'd lose the ability to update dependencies withversions-maven-plugin(update-properties+use-latest-releases), I assume because the properties are declared in onepom.xmland used in another. (It's possible that Dependabot is better about this, but we've had trouble getting it to work with our unusual 2-flavor, Google-repo-source-of-truth setup.)Tested:
RELNOTES=Changed our Maven project to avoid affecting which version of Mockito our Gradle users see.