Skip to content

Commit 2cc24a9

Browse files
committed
gradle: Remove version pinning from POMs
The pinning is unreliable in Maven and ignored by Gradle. I'm not at all convinced that we are pinning/not pinning in appropriate projects. The pinning also serves less of a purpose since we started encouraging the BOM and grpc-netty-shaded. Netty's HTTP/2 API has also become somewhat stable compared to its earlier history. If we notice an up-tick in version skew, we can reinstate it. The pinning is annoying in the build.gradle code and causes Maven/Gradle to download the version list once a day, which can be troublesome to users unaware of how to tell the tools to work offline. It also opens our users to platform issues like seen in #10043 and #10086 where Maven Central's version list was incorrectly generated. Or like #9664 where Gradle Plugin's repository caches packages from JCenter but the version list is not as cachable so exposed us to JCenter instability. This fixes #8357, by way of "we think we won't worry any more." See 90db93b when it was originally introduced. And issues like #8337, #3634.
1 parent 793fde8 commit 2cc24a9

File tree

5 files changed

+2
-45
lines changed

5 files changed

+2
-45
lines changed

alts/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,7 @@ publishing {
9595
def dependencyNode = dependenciesNode.appendNode('dependency')
9696
dependencyNode.appendNode('groupId', dep.group)
9797
dependencyNode.appendNode('artifactId', dep.name)
98-
def version = (dep.name == 'grpc-netty-shaded') ? '[' + dep.version + ']' : dep.version
99-
dependencyNode.appendNode('version', version)
98+
dependencyNode.appendNode('version', dep.version)
10099
dependencyNode.appendNode('scope', 'compile')
101100
}
102101
asNode().dependencies[0].replaceNode(dependenciesNode)

build.gradle

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -355,21 +355,6 @@ subprojects {
355355
organizationUrl = "https://www.google.com"
356356
}
357357
}
358-
359-
withXml {
360-
if (!(project.name in
361-
[
362-
"grpc-stub",
363-
"grpc-protobuf",
364-
"grpc-protobuf-lite",
365-
])) {
366-
asNode().dependencies.'*'.findAll() { dep ->
367-
dep.artifactId.text() in ['grpc-api', 'grpc-core']
368-
}.each() { core ->
369-
core.version*.value = "[" + core.version.text() + "]"
370-
}
371-
}
372-
}
373358
}
374359
}
375360
}

googleapis/build.gradle

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,3 @@ dependencies {
1717

1818
signature libraries.signature.java
1919
}
20-
21-
publishing {
22-
publications {
23-
maven(MavenPublication) {
24-
pom {
25-
withXml {
26-
// Since internal APIs are used, pin the version.
27-
asNode().dependencies.'*'.findAll() { dep ->
28-
dep.artifactId.text() in ['grpc-alts', 'grpc-xds']
29-
}.each() { core ->
30-
core.version*.value = "[" + core.version.text() + "]"
31-
}
32-
}
33-
}
34-
}
35-
}
36-
}

netty/shaded/build.gradle

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,6 @@ publishing {
111111
core.scope*.value = "compile"
112112
}
113113
}
114-
115-
// shadow.component() is run after the main build.gradle's withXml
116-
pom.withXml {
117-
asNode().dependencies.'*'.findAll() { dep ->
118-
dep.artifactId.text() in ['grpc-api', 'grpc-core']
119-
}.each() { core ->
120-
core.version*.value = "[" + core.version.text() + "]"
121-
}
122-
}
123114
}
124115
}
125116
}

xds/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,7 @@ publishing {
247247
def dependencyNode = dependenciesNode.appendNode('dependency')
248248
dependencyNode.appendNode('groupId', dep.group)
249249
dependencyNode.appendNode('artifactId', dep.name)
250-
def version = (dep.name == 'grpc-netty-shaded') ? '[' + dep.version + ']' : dep.version
251-
dependencyNode.appendNode('version', version)
250+
dependencyNode.appendNode('version', dep.version)
252251
dependencyNode.appendNode('scope', 'compile')
253252
}
254253
asNode().dependencies[0].replaceNode(dependenciesNode)

0 commit comments

Comments
 (0)