ascheman commented on PR #12771:
URL: https://github.com/apache/maven/pull/12771#issuecomment-5346430296
All five points are addressed in the latest commit.
**@gnodet — the separator observation was a real gap, not just theory.**
`isPreRelease` located the
qualifier with `indexOf('-')`, so `1.0.beta.1` (and `1.0_alpha_1`) slipped
through even though the
scheme considers them the same versions as `1.0-beta-1`. It now finds the
boundary by scanning
tokens: everything up to the first non-numeric token is the base version,
with `-`, `.` and `_`
treated alike. Both spellings are covered by the unit test.
**From the automated review:**
1. *Javadoc vs. snapshots* — kept the behaviour, fixed the description.
`isPreRelease` deliberately
answers "does this sort before its base version", which snapshots also
satisfy; the callers
classify snapshots first, so they never reach the pre-release bucket. The
Javadoc now says
exactly that instead of implying the method is limited to
alpha/beta/milestone/rc.
2. *Inconsistent log kinds* — now `RELEASE` / `PRE-RELEASE` / `SNAPSHOT`.
3. *`hasStableVersion` and unparseable versions* — good catch: an
unparseable entry counted as a
stable fallback while the selection loop (which parses) could never pick
it. It now requires the
version to be parseable by the configured `VersionScheme`, so the "a
stable one exists" decision
matches what is actually selectable.
4. *No unit test for the selection order* — added five, driving
`selectVersion` with a stubbed
`MavenPluginManager` so the ordering is observed on its own: a stable
version wins over the
pre-release the metadata names, the newest stable is taken, a pre-release
is used only when no
stable exists, a snapshot is the last resort, and a stable `<release>` is
taken as-is without a
search.
The unit test class is now 29 cases and the IT is unchanged. Behaviourally
the only difference to
the previous revision of this PR is that pre-releases written with `.` or
`_` separators are now
recognised as such; every version that was selected before is still selected.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]