You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
val gavFiles = allFiles.filter { it.normalizedPath.startsWith(gavPath) }
62
63
63
64
/**
@@ -69,58 +70,65 @@ private fun publishGav(
69
70
* - update the [version metadata](https://maven.apache.org/repositories/metadata.html).
70
71
* - patch the file names to include the new build number.
71
72
*
72
-
* See https://s01.oss.sonatype.org/content/repositories/snapshots/com/apollographql/apollo/apollo-api-jvm/maven-metadata.xml for an example.
73
-
*
74
73
* For snapshots, it's not 100% clear who owns the metadata as the repository might expire some snapshot and therefore need to rewrite the
75
74
* metadata to keep things consistent. This means there are 2 possibly concurrent writers to maven-metadata.xml: the repository and the
76
75
* publisher. Hopefully, it's not too much of a problem in practice.
77
76
*
78
77
* See https://github.com/gradle/gradle/blob/d1ee068b1ee7f62ffcbb549352469307781af72e/platforms/software/maven/src/main/java/org/gradle/api/publish/maven/internal/publisher/MavenRemotePublisher.java#L70.
78
+
*
79
79
*/
80
80
val versionMetadataPath ="$gavPath/maven-metadata.xml"
81
-
val localVersionMetadataFile = gavFiles.firstOrNull {
82
-
it.normalizedPath == versionMetadataPath
83
-
}
84
-
val localVersionMetadata =if (localVersionMetadataFile !=null) {
* Update the [artifact metadata](https://maven.apache.org/repositories/metadata.html).
137
145
*
138
-
* See https://repo1.maven.org/maven2/com/apollographql/apollo/apollo-api-jvm/maven-metadata.xml for an example.
146
+
* See https://repo1.maven.org/maven2/com/apollographql/apollo/apollo-api-jvm/maven-metadata.xml for an example of artifact metadata.
139
147
*/
140
148
val index = gavPath.lastIndexOf('/')
141
149
check(index !=-1) {
@@ -149,10 +157,10 @@ private fun publishGav(
149
157
groupId = gav.groupId,
150
158
artifactId = gav.artifactId,
151
159
versioning =ArtifactMetadata.Versioning(
152
-
latest = gav.version,
153
-
release = gav.version,
160
+
latest = gav.baseVersion,
161
+
release = gav.baseVersion,
154
162
versions = emptyList(),
155
-
lastUpdated = lastUpdated,
163
+
lastUpdated = lastUpdated.asTimestamp(false),
156
164
),
157
165
)
158
166
} else {
@@ -171,8 +179,8 @@ private fun publishGav(
171
179
* See https://github.com/gradle/gradle/blob/cb0c615fb8e3690971bb7f89ad80f58943360624/platforms/software/maven/src/main/java/org/gradle/api/publish/maven/internal/publisher/AbstractMavenPublisher.java#L116.
172
180
*/
173
181
val versions = existingVersions.toMutableList()
174
-
if (!versions.none { it == gav.version }) {
175
-
versions.add(gav.version)
182
+
if (!versions.none { it == gav.baseVersion }) {
183
+
versions.add(gav.baseVersion)
176
184
}
177
185
val newArtifactMetadata = localArtifactMetadata.copy(
0 commit comments