Commit b057cbd
fix: use maven-metadata.xml to look up the latest test framework version
The previous implementation queried search.maven.org's Solr endpoint and
returned the `latestVersion` field. That index has been frozen since
around May 2025 (a side effect of the Sonatype migration to
central.sonatype.com), so the endpoint now serves stale data. For
example, the latest version it reports for
`junit-platform-console-standalone` is `1.13.0-M3` (a JUnit 5 milestone),
while the actual current stable on Maven Central is `6.1.0`. As a
result, `Enable Java Tests` ends up downloading either that milestone
or, after falling back, the hard-coded `1.9.3`.
Switch the lookup to the artifact's own `maven-metadata.xml` on
repo1.maven.org, which is the authoritative metadata maintained
alongside the artifact:
* Prefer the `<release>` tag (Maven's pointer to the latest non-snapshot
version).
* Fall back to scanning `<version>` entries from newest to oldest for
the first stable build.
* Pre-release qualifiers (`-M*`, `-RC*`, `-beta`, `-SNAPSHOT`, etc.) are
rejected via `isStableVersion`.
Also bump the JUnit Jupiter `defaultVersion` from `1.9.3` to `6.1.0` so
the offline fallback matches a currently published stable.
Related to #1866
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 46c7835 commit b057cbd
1 file changed
Lines changed: 33 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
| 141 | + | |
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
175 | | - | |
| 175 | + | |
176 | 176 | | |
177 | | - | |
178 | | - | |
179 | | - | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
180 | 181 | | |
181 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
182 | 198 | | |
183 | 199 | | |
184 | 200 | | |
185 | 201 | | |
186 | 202 | | |
187 | 203 | | |
188 | 204 | | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
189 | 212 | | |
190 | 213 | | |
191 | 214 | | |
| |||
274 | 297 | | |
275 | 298 | | |
276 | 299 | | |
277 | | - | |
| 300 | + | |
278 | 301 | | |
279 | | - | |
| 302 | + | |
280 | 303 | | |
281 | 304 | | |
282 | 305 | | |
| |||
295 | 318 | | |
296 | 319 | | |
297 | 320 | | |
298 | | - | |
299 | 321 | | |
300 | 322 | | |
301 | 323 | | |
| |||
315 | 337 | | |
316 | 338 | | |
317 | 339 | | |
318 | | - | |
319 | | - | |
| 340 | + | |
| 341 | + | |
320 | 342 | | |
321 | 343 | | |
322 | 344 | | |
| |||
0 commit comments