Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Declare dependency versions inline instead of in our parent pom. #6659

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

copybara-service[bot]
Copy link
Contributor

Declare dependency versions inline instead of in our parent pom.

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.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

guava:32.1.1-jre causes issues with mockito-core:3.x
1 participant