From c6d35cf1a5617e96f41da0056dd2bc04f76ad0e5 Mon Sep 17 00:00:00 2001 From: Jendrik Johannes Date: Wed, 2 Aug 2023 12:02:13 -0700 Subject: [PATCH] Put the versions of dependencies directly in Gradle Metadata. This makes the version handling in POM and Gradle Metadata more similar. See https://github.com/google/guava/issues/6654#issuecomment-1656580773 We expect this to fix https://github.com/google/guava/issues/6657, though we don't fully understand it. Fixes #6664 RELNOTES=Changed Gradle Metadata to include dependency versions directly. This may address ["Could not find `some-dependency`" errors](https://github.com/google/guava/issues/6657) that some users have reported (which might be a result of users' excluding `guava-parent`). PiperOrigin-RevId: 553215970 --- android/pom.xml | 18 +++++--- guava/module.json | 110 +++++++++++++++++++++++----------------------- pom.xml | 18 +++++--- 3 files changed, 82 insertions(+), 64 deletions(-) diff --git a/android/pom.xml b/android/pom.xml index 38aa5ebc899a..4da902fd93ce 100644 --- a/android/pom.xml +++ b/android/pom.xml @@ -15,6 +15,10 @@ %regex[.*.class] 1.1.3 + 3.0.2 + 3.33.0 + 2.18.0 + 2.8 3.4.1 9+181-r4173-1 @@ -302,24 +306,28 @@ com.google.code.findbugs jsr305 - 3.0.2 + ${jsr305.version} org.checkerframework checker-qual - 3.33.0 + ${checker.version} com.google.errorprone error_prone_annotations - 2.18.0 + ${errorprone.version} com.google.j2objc j2objc-annotations - 2.8 + ${j2objc.version} - + diff --git a/guava/module.json b/guava/module.json index 9d78db10faee..1818f3549334 100644 --- a/guava/module.json +++ b/guava/module.json @@ -26,16 +26,6 @@ "org.gradle.usage": "java-api" }, "dependencies": [ - { - "group": "com.google.guava", - "module": "guava-parent", - "version": { - "requires": "${pom.version}" - }, - "attributes": { - "org.gradle.category": "platform" - } - }, { "group": "com.google.guava", "module": "failureaccess", @@ -52,19 +42,31 @@ }, { "group": "com.google.code.findbugs", - "module": "jsr305" + "module": "jsr305", + "version": { + "requires": "${jsr305.version}" + } }, { "group": "org.checkerframework", - "module": "checker-qual" + "module": "checker-qual", + "version": { + "requires": "${checker.version}" + } }, { "group": "com.google.errorprone", - "module": "error_prone_annotations" + "module": "error_prone_annotations", + "version": { + "requires": "${errorprone.version}" + } }, { "group": "com.google.j2objc", - "module": "j2objc-annotations" + "module": "j2objc-annotations", + "version": { + "requires": "${j2objc.version}" + } } ], "files": [ @@ -97,16 +99,6 @@ "org.gradle.usage": "java-runtime" }, "dependencies": [ - { - "group": "com.google.guava", - "module": "guava-parent", - "version": { - "requires": "${pom.version}" - }, - "attributes": { - "org.gradle.category": "platform" - } - }, { "group": "com.google.guava", "module": "failureaccess", @@ -123,15 +115,24 @@ }, { "group": "com.google.code.findbugs", - "module": "jsr305" + "module": "jsr305", + "version": { + "requires": "${jsr305.version}" + } }, { "group": "org.checkerframework", - "module": "checker-qual" + "module": "checker-qual", + "version": { + "requires": "${checker.version}" + } }, { "group": "com.google.errorprone", - "module": "error_prone_annotations" + "module": "error_prone_annotations", + "version": { + "requires": "${errorprone.version}" + } } ], "files": [ @@ -164,16 +165,6 @@ "org.gradle.usage": "java-api" }, "dependencies": [ - { - "group": "com.google.guava", - "module": "guava-parent", - "version": { - "requires": "${otherVariant.version}" - }, - "attributes": { - "org.gradle.category": "platform" - } - }, { "group": "com.google.guava", "module": "failureaccess", @@ -190,19 +181,31 @@ }, { "group": "com.google.code.findbugs", - "module": "jsr305" + "module": "jsr305", + "version": { + "requires": "${jsr305.version}" + } }, { "group": "org.checkerframework", - "module": "checker-qual" + "module": "checker-qual", + "version": { + "requires": "${checker.version}" + } }, { "group": "com.google.errorprone", - "module": "error_prone_annotations" + "module": "error_prone_annotations", + "version": { + "requires": "${errorprone.version}" + } }, { "group": "com.google.j2objc", - "module": "j2objc-annotations" + "module": "j2objc-annotations", + "version": { + "requires": "${j2objc.version}" + } } ], "files": [ @@ -235,16 +238,6 @@ "org.gradle.usage": "java-runtime" }, "dependencies": [ - { - "group": "com.google.guava", - "module": "guava-parent", - "version": { - "requires": "${otherVariant.version}" - }, - "attributes": { - "org.gradle.category": "platform" - } - }, { "group": "com.google.guava", "module": "failureaccess", @@ -261,15 +254,24 @@ }, { "group": "com.google.code.findbugs", - "module": "jsr305" + "module": "jsr305", + "version": { + "requires": "${jsr305.version}" + } }, { "group": "org.checkerframework", - "module": "checker-qual" + "module": "checker-qual", + "version": { + "requires": "${checker.version}" + } }, { "group": "com.google.errorprone", - "module": "error_prone_annotations" + "module": "error_prone_annotations", + "version": { + "requires": "${errorprone.version}" + } } ], "files": [ diff --git a/pom.xml b/pom.xml index 7e0fc9c54042..04fd3f4470c8 100644 --- a/pom.xml +++ b/pom.xml @@ -15,6 +15,10 @@ %regex[.*.class] 1.1.3 + 3.0.2 + 3.33.0 + 2.18.0 + 2.8 3.4.1 9+181-r4173-1 @@ -296,24 +300,28 @@ com.google.code.findbugs jsr305 - 3.0.2 + ${jsr305.version} org.checkerframework checker-qual - 3.33.0 + ${checker.version} com.google.errorprone error_prone_annotations - 2.18.0 + ${errorprone.version} com.google.j2objc j2objc-annotations - 2.8 + ${j2objc.version} - +