{"id":26593774,"url":"https://github.com/q3769/semver-maven-plugin","last_synced_at":"2025-08-21T07:16:27.871Z","repository":{"id":40587565,"uuid":"256881390","full_name":"q3769/semver-maven-plugin","owner":"q3769","description":"A Maven Plugin to update local POM version in compliance with Semantic Versioning 2.0.0","archived":false,"fork":false,"pushed_at":"2025-08-01T04:21:19.000Z","size":543,"stargazers_count":17,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-06T16:50:35.774Z","etag":null,"topics":["build-automation","cicd","cicd-pipeline","configuration-as-code","continious-integration","continuous-delivery","maven","maven-build","maven-plugin","pipeline-as-code","semantic-versioning","semver","semver-compare","software-version","version-automation","version-control","version-control-system","version-management"],"latest_commit_sha":null,"homepage":"https://q3769.github.io/semver-maven-plugin/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/q3769.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"q3769","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":"q3769","issuehunt":null,"otechie":null,"custom":null}},"created_at":"2020-04-19T00:29:47.000Z","updated_at":"2025-08-01T06:38:13.000Z","dependencies_parsed_at":"2024-01-15T21:47:46.660Z","dependency_job_id":"3ead8e09-0897-4fab-a11f-aa1f919bce0e","html_url":"https://github.com/q3769/semver-maven-plugin","commit_stats":null,"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"purl":"pkg:github/q3769/semver-maven-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/q3769%2Fsemver-maven-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/q3769%2Fsemver-maven-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/q3769%2Fsemver-maven-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/q3769%2Fsemver-maven-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/q3769","download_url":"https://codeload.github.com/q3769/semver-maven-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/q3769%2Fsemver-maven-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271442161,"owners_count":24760353,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-21T02:00:08.990Z","response_time":74,"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":["build-automation","cicd","cicd-pipeline","configuration-as-code","continious-integration","continuous-delivery","maven","maven-build","maven-plugin","pipeline-as-code","semantic-versioning","semver","semver-compare","software-version","version-automation","version-control","version-control-system","version-management"],"created_at":"2025-03-23T15:20:25.922Z","updated_at":"2025-08-21T07:16:27.855Z","avatar_url":"https://github.com/q3769.png","language":"Java","funding_links":["https://github.com/sponsors/q3769","https://liberapay.com/q3769"],"categories":[],"sub_categories":[],"readme":"[![Maven Central](https://img.shields.io/maven-central/v/io.github.q3769/semver-maven-plugin.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22io.github.q3769%22%20AND%20a:%22semver-maven-plugin%22)\n\n# semver-maven-plugin\n\nA [Maven Plugin](https://maven.apache.org/plugins/index.html) to update the project version in the local `pom.xml`\nfile according to the [Semantic Versioning 2.0.0](https://semver.org/) specification\n\n## User story\n\nAs a user of this Maven Plugin, I want to update my project's version in the local `pom.xml` file according\nto the Semantic Versioning 2.0.0 specifications, by issuing Maven commands from CLI or build script/code.\n\n_Notes:_\n\n- Unlike some other Maven versioning plugins, this one does not try to include or combine any extra functionalities\n  beyond local POM version change. In and of itself, for example, the plugin does not communicate with any version\n  control system or artifact repository: It has one single concern - the project's version as defined in the local\n  `pom.xml` file.\n- Command-line-invokable as an atomic and composable action/step, the plugin aims to suit whatever CI/CD pipeline\n  workflow one may care to set up by script/code.\n\n## Prerequisite\n\nMaven 3.9.0 or better\n\n## Get it...\n\nInclude this plugin in `pom.xml`:\n\n```\n\u003cbuild\u003e\n    \u003cplugins\u003e\n        \u003cplugin\u003e\n            \u003cgroupId\u003eio.github.q3769\u003c/groupId\u003e\n            \u003cartifactId\u003esemver-maven-plugin\u003c/artifactId\u003e\n            \u003cversion\u003e${latest.version}\u003c/version\u003e\n        \u003c/plugin\u003e\n```            \n\n## Use it...\n\n_Note:_ By default, only the parent project's version is processed, module versions are not. Use\nthe `-DprocessModule` command flag if you also wish to process modules.\n\nFrom CLI, assuming you are in the Maven project's default root directory where the `pom.xml` file is located:\n\n### Hard set\n\n```shell\nmvn semver:set-current -Dsemver=blah\n```\n\nerrors out because `blah` is not a valid SemVer\n\n```shell\nmvn semver:set-current -Dsemver=1.2.3-beta\n```\n\nsets the new value of the version element of the `pom.xml` file to be `1.2.3-beta`, regardless of the original value in\nPOM\n\n### Increment normal version number\n\n```shell\nmvn semver:increment-major\n```\n\nincrements `1.2.3-beta.1` into `2.0.0`, where `1.2.3-beta.1` is the original POM value\n\n```shell\nmvn semver:increment-minor -Dsnapshot=true\n```\n\nincrements `1.2.3 into 1.3.0-SNAPSHOT`. Note that `snapshot` is a convenience flag to set the target pre-release label\nas `SNAPSHOT` with no build meta label. This labeling shorthand only works with a normal version increment - major,\nminor, or patch. To set the labels other ways, see examples in the Pre-release and Build Metadata labels section.\n\n```shell\nmvn semver:increment-patch\n```\n\nincrements `1.2.3-beta.1` into `1.2.4`\n\nAssuming now is 1PM on Jan 31, 2021 in UTC time zone, then:\n\n```shell\nmvn semver:calendar-major\n```\n\nincrements `1.2.3` into `2021.0.0`; `20201225.2.3-beta.1` into `20210131.0.0`; `2021.2.3`\ninto `202101.0.0`; `20210131.2.3` into `2021013113.0.0`, etc...\n\nThis goal uses the current calendar datetime as the target `major` number: It tries to increase the precision\nof the current time stamp until the value is larger than the original `major` version number; then uses that\ntime stamp value as the replacement. If the original `major` number is too large to replace even when increasing\nthe current time precision to milliseconds, then the goal errors out and no update will be performed to the POM.\n\n```shell\nmvn semver:calendar-minor\n```\n\napplies similar manipulations as with `semver:calendar-major`, to the `minor` normal version number of the original\nsemver.\n\n```shell\nmvn semver:calendar-patch\n```\n\napplies similar manipulations as with `semver:calendar-major`, to the `patch` normal version number of the original\nsemver.\n\n### Update pre-release version and build metadata\n\n```shell\nmvn semver:update-pre-release\n```\n\nincrements `1.2.3-beta` into `1.2.3-beta.1`\n\n```shell\nmvn semver:update-build-metadata\n```\n\nincrements `1.2.3-beta.1+build.10` into `1.2.3-beta.1+build.11`.\n\nUsing this goal alone, without the `Dset=...` parameter (mentioned later), is deprecated as SemVer spec\nexcludes using build metadata for precedence or equavalance comparison; thus, there is no definitive way\nto increment build metadata.\n\n```shell\nmvn semver:update-pre-release -Dset=beta\n```\n\nupdates/sets `1.2.3-alpha+build.7` into `1.2.3-beta`\n\n```shell\nmvn semver:update-build-metadata -Dset=build.reno\n```\n\nupdates/sets `1.2.3-alpha` into `1.2.3-alpha+build.reno`\n\n### Pick the newer between the pom version and another semver\n\n```shell\nmvn semver:pick-newer -Dsemver=1.3.0-HOTFIX\n```\n\nupdates the original POM version `1.2.3` to `1.3.0-HOTFIX` because `1.3.0-HOTFIX` is a newer version than `1.2.3`.\nHowever, if the original version were `1.3.0`, then no change would have been made because, according to the SemVer\nprecedence, the original `1.3.0` is newer than the given `1.3.0-HOTFIX`. (Note that a final SemVer is always newer\nthan any labeled counterpart, regardless the label's semantics. That is, the final/stable \"hot fix\" SemVer of `1.3.0`\nwould be `1.3.1`, not `1.3.0-HOTFIX` or `1.3.1-HOTFIX`.)\n\n### Merge with another semver\n\n```shell\nmvn semver:merge -Dsemver=1.3.10-HOTFIX\n```\n\nupdates `1.2.0-SNAPSHOT+chi.1` into `1.4.0-SNAPSHOT+chi.1`, where `1.2.0-SNAPSHOT+chi.1` is the current POM version.\n\n- This merge strategy is opinionated. The SemVer spec itself only defines the order of precedence among versions, and\n  does not mention merging.\n\nThe basic idea here is to center the merge process around the current version in the `pom.xml` file. I.e., the intents\nand purposes of the current POM version will dominate those of the given SemVer to merge.\n\n1. Take the newer between the current POM version and the given version to merge, according to the SemVer precedence.\n\n2. If the current POM version is newer, no change will be made and the current POM version is the merge result.\n   Otherwise, if the given version to merge is newer, then to form the merge result, the given version is to be\n   incremented on the **last incremented normal version of the current POM version** - `major`, `minor`, or `patch`.\n\n4. The current POM version's pre-release and build metadata labels, if any exist, always stay and serve as the final\n   merged version's labels.\n\nIn this case, the given version `1.3.10-HOTFIX` is newer, so it is to be incremented to form the merge result. The\nlast incremented normal version of the current POM version `1.2.0-SNAPSHOT+chi.1` is `minor`, so the given version\n`1.3.10-HOTFIX` is incremented on its own `minor` version number, resulting in `1.4.0` per SemVer spec. (Note that the\ngiven version `1.3.10-HOTFIX`'s last incremented normal version is `patch` but that anyway does not matter per the merge\nrules here.) Then, the current POM version's labels (in this case `SNAPSHOT` and `chi.1`), if any exist, always stay as\nthey are. Thus, for the final merged version, we have `1.4.0-SNAPSHOT+chi.1`.\n\nAssuming now is 1PM on Jan 31, 2021, then:\n\n```shell\nmvn semver:merge-calendar -Dsemver=1.3.10-HOTFIX\n```\n\nupdates `1.2.0-SNAPSHOT+chi.1` into `1.2021.0-SNAPSHOT+chi.1`, where `1.2.0-SNAPSHOT+chi.1` is the current POM version.\nThis goal performs similar functions as with `semver:merge`, but using calendar value as the update result instead of\nsimple increment.\n\n### Finalize current version\n\n```shell\nmvn semver:finalize-current\n```\n\nchanges `1.2.3-SNAPSHOT` or `1.2.3-beta.1+build.10` into `1.2.3`, stripping off all additional labels\n\n### Verify the current pom version\n\n```shell\nmvn semver:verify-current\n```\n\nprints confirmation message if the current version of the local POM is in valid SemVer format, errors otherwise.\n\n```shell\nmvn semver:verify-current -Dforce-stdout -q\n```\n\nprints the current POM version and nothing else (e.g. `1.2.3-beta.4+build.5`) in std out if it is a valid SemVer.\nFor a clean print out of the project's SemVer with nothing else, you need the `-q` or `--quiet` option to suppress\nthe usual Maven messages.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fq3769%2Fsemver-maven-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fq3769%2Fsemver-maven-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fq3769%2Fsemver-maven-plugin/lists"}