{"id":42817654,"url":"https://github.com/unbroken-dome/gradle-gitversion-plugin","last_synced_at":"2026-01-30T06:43:44.012Z","repository":{"id":14769094,"uuid":"76206016","full_name":"unbroken-dome/gradle-gitversion-plugin","owner":"unbroken-dome","description":"Gradle Git Version Plugin","archived":false,"fork":false,"pushed_at":"2022-05-19T09:15:42.000Z","size":199,"stargazers_count":7,"open_issues_count":4,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-23T11:43:07.713Z","etag":null,"topics":["git","gradle","gradle-plugin","version","version-control","versioning"],"latest_commit_sha":null,"homepage":null,"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/unbroken-dome.png","metadata":{"files":{"readme":"README.adoc","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}},"created_at":"2016-12-11T23:14:34.000Z","updated_at":"2023-10-03T14:52:30.000Z","dependencies_parsed_at":"2022-08-07T08:00:34.473Z","dependency_job_id":null,"html_url":"https://github.com/unbroken-dome/gradle-gitversion-plugin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/unbroken-dome/gradle-gitversion-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unbroken-dome%2Fgradle-gitversion-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unbroken-dome%2Fgradle-gitversion-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unbroken-dome%2Fgradle-gitversion-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unbroken-dome%2Fgradle-gitversion-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unbroken-dome","download_url":"https://codeload.github.com/unbroken-dome/gradle-gitversion-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unbroken-dome%2Fgradle-gitversion-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28906828,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T06:42:00.998Z","status":"ssl_error","status_checked_at":"2026-01-30T06:41:58.659Z","response_time":66,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["git","gradle","gradle-plugin","version","version-control","versioning"],"created_at":"2026-01-30T06:43:43.485Z","updated_at":"2026-01-30T06:43:44.001Z","avatar_url":"https://github.com/unbroken-dome.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"= Gradle Git Version Plugin\n\nA plugin for the Gradle build system that helps with determining a project's version from its Git repository.\n\n== Rationale\n\nTraditionally, the version of a software project is kept in a text file with the code, e.g. the _gradle.properties_ file\nor the build script itself. This file would have to be updated for each new version, which has a couple of\ndisadvantages: Firstly, it requires high maintenance and discipline by the developer, which makes the delivery\nprocess either error prone, or dependent on such abominations as the\nhttp://maven.apache.org/maven-release/maven-release-plugin/[Maven Release Plugin].\nSecondly, it makes branching and merging much more difficult, because it either leads to version clashes between\nbranches, or requires the first commit on any new branch to be a version change (which must not be merged into another\nbranch later).\n\nAs most modern software projects are kept under version control in a https://git-scm.com/[Git] repository, which\nalready contains rich version-related information, an attractive alternative is to keep version information out of\nthe code entirely, and determine the version entirely from the Git repository.\n\nThere are already several Gradle plugins that help with this approach, including\nhttps://plugins.gradle.org/plugin/com.zoltu.git-versioning[com.zoltu.git-versioning],\nhttps://plugins.gradle.org/plugin/io.freefair.git-version[io.freefair.git-version],\nhttps://plugins.gradle.org/plugin/com.palantir.git-version[com.palantir.git-version] and\nhttps://github.com/amkay/gradle-gitflow[com.github.amkay.gitflow].\nHowever, these plugins are either very simplistic in their approach (like being based only on `git describe`, or\nthe presence of tags), or very opinionated about the way you should use Git (e.g. require you to subscribe to the\nhttp://nvie.com/posts/a-successful-git-branching-model/[Git Flow] process).\n\nThis plugin, in contrast, makes very little assumptions about your specific usage of Git; instead it allows you\ndefine flexible versioning rules in your Gradle script. In fact, the only assumption is that you are producing a\nversion that complies with the format of http://semver.org/[Semantic Versioning] format (but not necessarily its\nsemantics).\n\n== Quickstart\n\n=== Applying the Plugin\n\nAdd the following at the beginning of your Gradle build script:\n\n[source,groovy]\n----\nplugins {\n  id \"org.unbroken-dome.gitversion\" version \"0.10.0\"\n}\n----\n\nApplying the plugin installs a `gitVersion` extension in the DSL, as well as some tasks used for versioning.\n\n=== Defining rules\n\nThe plugin does not offer much value without at least one versioning rule. Rules can be as simple or complex as you\nlike, and you can add any number of rules to the `gitVersion.rules` block:\n\n[source,groovy]\n----\ngitVersion {\n  rules {\n\n    onBranch('master') {\n      version = '1.0.0-master'\n    }\n\n    onBranch(~/release\\/(\\d+\\.\\d+)/) {\n      version = matches[1]\n    }\n  }\n}\n----\n\nThe above example would distinguish between the branch that is currently checked out. The first rule states that on the\n`master` branch, the resulting version should always be `0.1.0-master`. The second rule uses a regular expression to\nmatch the name pattern of a release branch, and extracts the version from the branch name. For example, a branch named\n`release/1.2` would lead to the version `1.2.0` (The third part of the version is automatically set to `0` because\n`1.2` would not be a valid semver.)\n\nRead more about \u003c\u003cdocs/defining-rules.adoc,Defining Rules\u003e\u003e in the detailed documentation.\n\n=== Using the Version\n\nIn Gradle, the project's version is stored in the `version` property of the project. The plugin does not touch it\nautomatically, as it offers various ways to determine it.\n\nThe easiest way is to call the `determineVersion` method on the `gitVersion` extension after defining your rules:\n\n[source,groovy]\n----\nproject.version = gitVersion.determineVersion()\n----\n\nNote that `determineVersion` is a method, not a Gradle task! The reason for this is that the version is generally\nrequired during the evaluation phase, in order to configure other tasks - so setting it in a task (during the\nexecution phase) would be too late.\n\nRead more about \u003c\u003cdocs/determine-version,Determining the Version\u003e\u003e, including alternative approaches, in the detailed\ndocumentation.\n\n== Detailed Documentation\n\nPlease refer to the https://github.com/unbroken-dome/gradle-gitversion-plugin/wiki[Wiki] for\ndetailed documentation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funbroken-dome%2Fgradle-gitversion-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funbroken-dome%2Fgradle-gitversion-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funbroken-dome%2Fgradle-gitversion-plugin/lists"}