{"id":32516436,"url":"https://github.com/dmfs/semver","last_synced_at":"2026-07-09T05:31:53.888Z","repository":{"id":44599252,"uuid":"439161816","full_name":"dmfs/semver","owner":"dmfs","description":"Another Semantic Versioning 2.0.0 implementation for Java.","archived":false,"fork":false,"pushed_at":"2024-05-12T21:02:58.000Z","size":77,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-28T01:53:46.369Z","etag":null,"topics":["java","semantic-versioning","semver"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dmfs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-17T00:14:32.000Z","updated_at":"2024-05-12T21:02:06.000Z","dependencies_parsed_at":"2024-05-11T17:26:16.922Z","dependency_job_id":"2f9f051f-f93f-4fa9-8f1a-5845b9fae458","html_url":"https://github.com/dmfs/semver","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/dmfs/semver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmfs%2Fsemver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmfs%2Fsemver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmfs%2Fsemver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmfs%2Fsemver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmfs","download_url":"https://codeload.github.com/dmfs/semver/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmfs%2Fsemver/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35288805,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-09T02:00:07.329Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","semantic-versioning","semver"],"created_at":"2025-10-28T01:53:33.045Z","updated_at":"2026-07-09T05:31:53.883Z","avatar_url":"https://github.com/dmfs.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build](https://github.com/dmfs/semver/actions/workflows/main.yml/badge.svg?label=main)](https://github.com/dmfs/semver/actions/workflows/main.yml)  \n[![codecov](https://codecov.io/gh/dmfs/semver/branch/main/graph/badge.svg?token=2vzHFiHKGk)](https://codecov.io/gh/dmfs/semver)  \n[![Confidence](https://img.shields.io/badge/Tested_with-Confidence-800000?labelColor=white)](https://saynotobugs.org/confidence)\n\n# semver\n\nAnother [Semantic Versioning 2.0.0](https://semver.org/spec/v2.0.0.html) implementation for Java.\n\n## TODOs\n\n* implement lax parser\n* validate pre-release \u0026 build identifiers\n\n## Usage\n\n### Create a version from scratch\n\n```java\nVersion version = new Release(1, 0, 0); // creates 1.0.0\n```\n\n### Version math\n\nGiven a current version `v`, new versions are derived by\napplying a decorator. The following matrix show the result of\neach decorator for a given version (click the links on the decorators for more examples).\n\n| Decorator                                                                                                               | 1.0.0       | 1.1.0       | 1.0.1       | 2.0.0-beta.1 | 1.1.0-beta.1 | 1.0.1-beta.1 |\n|-------------------------------------------------------------------------------------------------------------------------|-------------|-------------|-------------|--------------|--------------|--------------|\n| [`new NextMajor(v)`](https://github.com/dmfs/semver/blob/main/src/main/java/org/dmfs/semver/NextMajor.java)             | 2.0.0       | 2.0.0       | 2.0.0       | 2.0.0        | 2.0.0        | 2.0.0        |\n| [`new NextMinor(v)`](https://github.com/dmfs/semver/blob/main/src/main/java/org/dmfs/semver/NextMinor.java)             | 1.1.0       | 1.2.0       | 1.1.0       | 2.0.0        | 1.1.0        | 1.1.0        |\n| [`new NextPatch(v)`](https://github.com/dmfs/semver/blob/main/src/main/java/org/dmfs/semver/NextPatch.java)             | 1.0.1       | 1.1.1       | 1.0.2       | 2.0.0        | 1.1.0        | 1.0.1        |\n| [`new MajorPreRelease(v)`](https://github.com/dmfs/semver/blob/main/src/main/java/org/dmfs/semver/MajorPreRelease.java) | 2.0.0-alpha | 2.0.0-alpha | 2.0.0-alpha | 3.0.0-alpha  | 2.0.0-alpha  | 2.0.0-alpha  |\n| [`new MinorPreRelease(v)`](https://github.com/dmfs/semver/blob/main/src/main/java/org/dmfs/semver/MinorPreRelease.java) | 1.1.0-alpha | 1.2.0-alpha | 1.1.0-alpha | 2.1.0-alpha  | 1.2.0-alpha  | 1.1.0-alpha  |\n| [`new PatchPreRelease(v)`](https://github.com/dmfs/semver/blob/main/src/main/java/org/dmfs/semver/PatchPreRelease.java) | 1.0.1-alpha | 1.1.1-alpha | 1.0.2-alpha | 2.0.1-alpha  | 1.1.1-alpha  | 1.0.2-alpha  |\n| [`new NextPreRelease(v)`](https://github.com/dmfs/semver/blob/main/src/main/java/org/dmfs/semver/NextPreRelease.java)   | 1.1.0-alpha | 1.2.0-alpha | 1.1.0-alpha | 2.0.0-beta.2 | 1.1.0-beta.2 | 1.0.1-beta.2 |\n| `new MajorPreRelease(v, \"beta\")`                                                                                        | 2.0.0-beta  | 2.0.0-beta  | 2.0.0-beta  | 2.0.0-beta.2 | 2.0.0-beta   | 2.0.0-beta   |\n| `new MinorPreRelease(v, \"beta\")`                                                                                        | 1.1.0-beta  | 1.2.0-beta  | 1.1.0-beta  | 2.0.0-beta.2 | 1.1.0-beta.2 | 1.1.0-beta.1 |\n| `new PatchPreRelease(v, \"beta\")`                                                                                        | 1.0.1-beta  | 1.1.1-beta  | 1.0.2-beta  | 2.0.0-beta.2 | 1.1.0-beta.2 | 1.0.1-beta.2 |\n| `new NextPreRelease(v, \"beta\")`                                                                                         | 1.1.0-beta  | 1.2.0-beta  | 1.1.0-beta  | 2.0.0-beta.2 | 1.1.0-beta.2 | 1.0.1-beta.2 |\n\nNote, that some of these decorators exist in other variants\nwith slightly different behavior. The Matrix shows the most common ones.\n\nAlso note, `NextPreRelease` increases the pre-release version if there is one and creates a pre-release for the next\nminor version otherwise.\n\n### Conversion to CharSequence/String\n\nThe `Version` implementations do only a single thing, represent a version. To get a `CharSequence`\nrepresentation you use a dedicated adapter class called `VersionSequence`, on which you can call `toString()` if you\nneed a `String`\n\n```java\nCharSequence ver = new VersionSequence(version);\nString verString = new VersionSequence(version).toString();\n```\n\n## License\n\nCopyright 2024 dmfs GmbH\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmfs%2Fsemver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmfs%2Fsemver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmfs%2Fsemver/lists"}