zafarkhaja / jsemver

Java implementation of the SemVer Specification
MIT License
429 stars 82 forks source link

Add ability to parse version without 3 increments (x.y.z) #49

Closed famaridon closed 1 year ago

famaridon commented 5 years ago

Hello, I have added the ability to parse non-fully compatible versions like 1.0-SNAPSHOT because in our project we would like to use SemVer. But we have some legacy versions and we need to support them (while converting them to SemVer).

I added 3 methods parseCompatibleSemVer because parseValidSemVer should have valid input like the method explicitly says.

I added default strategies to handle missing increments with a replacement by 0 or an exception thrown. This allow to use customs strategies like log WARN and default with 0.

heisluft commented 5 years ago

The original project is stale as of 2015. My Fork has that and other features implemented.

zafarkhaja commented 1 year ago

Looks like just a different approach to the same functionality as in #29.

zafarkhaja commented 1 year ago

Hello @famaridon, I hope you're doing well!

I'm sorry it took me this long to get back to you.

I appreciate you taking the time and effort to contribute. I totally understand the use case and the need for this functionality but unfortunately, as I've said on numerous occasions elsewhere, I'm not willing to deviate from the Specification in the default parser. I still am planning to support this in some future release, but with a separate parser.

Have a nice day,