Skip to content

Conversation

@HarshMehta112
Copy link
Contributor

@HarshMehta112 HarshMehta112 commented Nov 27, 2025

Following this checklist to help us incorporate your
contribution quickly and easily:

  • Your pull request should address just one issue, without pulling in other changes.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Each commit in the pull request should have a meaningful subject line and body.
    Note that commits might be squashed by a maintainer on merge.
  • Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied.
    This may not always be possible but is a best-practice.
  • Run mvn verify to make sure basic checks pass.
    A more thorough check will be performed on your pull request automatically.
  • You have run the integration tests successfully (mvn -Prun-its verify).

If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.

I've gone ahead and applied for the Individual Contributor License Agreement.

To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.

Replace archived org.semver:api with custom SemVer implementation

Fixes #1426

What changed

  • Removed dependency on the archived org.semver:api library.
  • Introduced a custom internal semantic-versioning implementation: renamed class from VersionSemVer, and refactored related version-policy code under maven-release-semver-policy.
  • Updated all references, method calls, and tests to use the new SemVer class.
  • Existing unit and integration tests updated accordingly and pass successfully.

HarshMehta112 and others added 3 commits November 26, 2025 21:16
… into 1410

# Conflicts:
#	maven-release-policies/maven-release-semver-policy/pom.xml
#	maven-release-policies/maven-release-semver-policy/src/main/java/org/apache/maven/shared/release/policy/semver/SemVerVersionPolicy.java
…rsion policies and update related methods

Signed-off-by: Harsh Mehta <[email protected]>
Copy link
Contributor

@elharo elharo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good start. This is going to need some thought and discussion. If we can reduce the visibility to package protected that would enable us to release and iterate.

Copy link
Contributor

@elharo elharo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Run 'mvn spotless:apply' to fix these violations.

@HarshMehta112
Copy link
Contributor Author

@elharo @slawekjaranowski
Could you please clarify how you would like this feature to be implemented? As discussed with @slawekjaranowski, the suggestion was to follow the SemVer 2.0.0 specification (#1426). I also observed that the existing SemVerVersion-related policies and test cases are already aligned with SemVer 2.0.0, and we could potentially use the recommended regular expression provided in the SemVer documentation: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string.

However, @elharo pointed out that Maven only compatible with SemVer 1.0.0.

Since I am still new to open-source contribution, I am trying to fully understand the intended direction. Could you please advise on the preferred approach so I can proceed accordingly?

Thank you!

@slawekjaranowski
Copy link
Member

@elharo @kwin look ok for me

@slawekjaranowski slawekjaranowski added this to the 3.3.0 milestone Nov 30, 2025
@slawekjaranowski slawekjaranowski added the enhancement New feature or request label Nov 30, 2025
@slawekjaranowski slawekjaranowski changed the title Fixed #1426 : Fix(maven-release-semver-policy) : Replace archived org.semver:api with custom SemVer implementation Fixed #1426 : Replace archived org.semver:api with custom SemVer implementation Nov 30, 2025
@slawekjaranowski slawekjaranowski merged commit 88630f9 into apache:master Nov 30, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace org.semver:api

5 participants