HarshMehta112 commented on issue #1426:
URL: https://github.com/apache/maven-release/issues/1426#issuecomment-3576760946
@slawekjaranowski
I think a lightweight in-house SemVer implementation would better fit our
needs here. The current version feels more complex than required, and
simplifying it would reduce maintenance overhead while keeping the logic
focused on the actual functionality we use.
A minimal approach would only include:
```java
// Parse: MAJOR.MINOR.PATCH[-pre][+meta]
Matcher m = PATTERN.matcher(version);
if (!m.matches()) {
throw new IllegalArgumentException("Invalid version: " + version);
}
```
```java
// Increment version element
switch (element) {
case MAJOR: return new SemVer(major + 1, 0, 0, null, null);
case MINOR: return new SemVer(major, minor + 1, 0, null, null);
case PATCH: return new SemVer(major, minor, patch + 1, null, null);
}
```
If this approach aligns with the project direction, I’m happy to refine or
extend it as needed. As I'm still new to contributing, feedback is welcome!
--
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]