{"id":13734550,"url":"https://github.com/researchgate/gradle-release","last_synced_at":"2025-05-14T13:05:47.352Z","repository":{"id":5952056,"uuid":"7173018","full_name":"researchgate/gradle-release","owner":"researchgate","description":"gradle-release is a plugin for providing a Maven-like release process for projects using Gradle","archived":false,"fork":false,"pushed_at":"2024-12-23T23:03:18.000Z","size":1151,"stargazers_count":873,"open_issues_count":136,"forks_count":221,"subscribers_count":39,"default_branch":"main","last_synced_at":"2025-04-13T08:58:45.231Z","etag":null,"topics":["gradle-plugin","gradle-release","release-automation"],"latest_commit_sha":null,"homepage":"","language":"Groovy","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/researchgate.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-12-14T22:35:33.000Z","updated_at":"2025-04-04T21:05:08.000Z","dependencies_parsed_at":"2024-07-08T09:19:31.236Z","dependency_job_id":"e5c3466b-b08e-4882-b756-a168f1d63c4c","html_url":"https://github.com/researchgate/gradle-release","commit_stats":{"total_commits":547,"total_committers":57,"mean_commits":9.596491228070175,"dds":0.6581352833638026,"last_synced_commit":"5e2b22bd088bdcbfc26d08fd16433323faee16b4"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/researchgate%2Fgradle-release","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/researchgate%2Fgradle-release/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/researchgate%2Fgradle-release/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/researchgate%2Fgradle-release/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/researchgate","download_url":"https://codeload.github.com/researchgate/gradle-release/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254149919,"owners_count":22022851,"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","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":["gradle-plugin","gradle-release","release-automation"],"created_at":"2024-08-03T03:00:57.303Z","updated_at":"2025-05-14T13:05:47.315Z","avatar_url":"https://github.com/researchgate.png","language":"Groovy","funding_links":[],"categories":["Plugins","\u003ca name=\"Groovy\"\u003e\u003c/a\u003eGroovy"],"sub_categories":["Releasing"],"readme":"# gradle-release plugin\n\n[![Build Status](https://github.com/researchgate/gradle-release/actions/workflows/tests.yaml/badge.svg)](https://github.com/researchgate/gradle-release/actions/workflows/tests.yaml)\n[Gradle Plugin page](https://plugins.gradle.org/plugin/net.researchgate.release)\n\n## Introduction\n\nThe gradle-release plugin is designed to work similar to the Maven release plugin.\nThe `gradle release` task defines the following as the default release process:\n\n* The plugin checks for any un-committed files (Added, modified, removed, or un-versioned).\n* Checks for any incoming or outgoing changes.\n* Checkout to the release branch and merge from the working branch (optional, for GIT only, with `pushReleaseVersionBranch`)\n* Removes the SNAPSHOT flag on your project's version (If used)\n* Prompts you for the release version.\n* Checks if your project is using any SNAPSHOT dependencies\n* Will `build` your project.\n* Commits the project if SNAPSHOT was being used.\n* Creates a release tag with the current version.\n* Checkout to the working branch (optional, for GIT only, with `pushReleaseVersionBranch`)\n* Prompts you for the next version.\n* Commits the project with the new version.\n\nCurrent SCM support: [Bazaar](http://bazaar.canonical.com/en/), [Git](http://git-scm.com/) (1.7.2 or newer), [Mercurial](http://mercurial.selenic.com/), and [Subversion](http://subversion.apache.org/)\n\n## Installation\n\nThe gradle-release plugin will work with Gradle 6.0 and beyond\n\n### Legacy plugin application\n\n```groovy\nbuildscript {\n  repositories {\n    maven {\n      url 'https://plugins.gradle.org/m2/'\n    }\n  }\n  dependencies {\n    classpath 'net.researchgate:gradle-release:3.1.0'\n  }\n}\n\napply plugin: 'net.researchgate.release'\n```\n\n### Plugin DSL\n\n```groovy\nplugins {\n  id 'net.researchgate.release' version '3.1.0'\n}\n```\n\nPlease refer to the [Gradle DSL PluginDependenciesSpec](http://www.gradle.org/docs/current/dsl/org.gradle.plugin.use.PluginDependenciesSpec.html) to\nunderstand the behavior and limitations when using the new syntax to declare plugin dependencies.\n\n## Usage\n\nAfter you have your `build.gradle` file configured, simply run: `gradle release` and follow the on-screen instructions.\n\n### Configuration\n\nAs described above, the plugin will check for un-committed files and SNAPSHOT dependencies.\nBy default the plugin will fail when any un-committed, or SNAPSHOT dependencies are found.\n\nBelow are some properties of the Release Plugin Convention that can be used to make your release process more lenient\n\n\u003ctable border=\"0\"\u003e\n\t\u003ctr\u003e\n\t\t\u003cth\u003eName\u003c/th\u003e\n\t\t\u003cth\u003eDefault value\u003c/th\u003e\n\t\t\u003cth\u003eDescription\u003c/th\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003efailOnCommitNeeded\u003c/td\u003e\n\t\t\u003ctd\u003etrue\u003c/td\u003e\n\t\t\u003ctd\u003eFail the release process when there are un-committed changes. Will commit files automatically if set to false.\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003efailOnPublishNeeded\u003c/td\u003e\n\t\t\u003ctd\u003etrue\u003c/td\u003e\n\t\t\u003ctd\u003eFail when there are local commits that haven't been published upstream (DVCS support)\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003efailOnSnapshotDependencies\u003c/td\u003e\n\t\t\u003ctd\u003etrue\u003c/td\u003e\n\t\t\u003ctd\u003eFail when the project has dependencies on SNAPSHOT versions unless those SNAPSHOT dependencies have been defined as \u003ci\u003e'ignoredSnapshotDependencies'\u003c/i\u003e using the syntax '$group:$name'\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003efailOnUnversionedFiles\u003c/td\u003e\n\t\t\u003ctd\u003etrue\u003c/td\u003e\n\t\t\u003ctd\u003eFail when files are found that are not under version control\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003efailOnUpdateNeeded\u003c/td\u003e\n\t\t\u003ctd\u003etrue\u003c/td\u003e\n\t\t\u003ctd\u003eFail when the source needs to be updated, or there are changes available upstream that haven't been pulled\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003erevertOnFail\u003c/td\u003e\n\t\t\u003ctd\u003etrue\u003c/td\u003e\n\t\t\u003ctd\u003eWhen a failure occurs should the plugin revert it's changes to gradle.properties?\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003epushReleaseVersionBranch\u003c/td\u003e\n\t\t\u003ctd\u003enull\u003c/td\u003e\n\t\t\u003ctd\u003e(GIT only) If set to the name of a branch, the `release` task will commit the release on this branch, and the next version on the working branch.\u003c/td\u003e\n\t\u003c/tr\u003e\n\u003c/table\u003e\n\nBelow are some properties of the Release Plugin Convention that can be used to customize the build\u003cbr\u003e\n\u003ctable\u003e\n\t\u003ctr\u003e\n\t\t\u003cth\u003eName\u003c/th\u003e\n\t\t\u003cth\u003eDefault value\u003c/th\u003e\n\t\t\u003cth\u003eDescription\u003c/th\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003etagTemplate\u003c/td\u003e\n\t\t\u003ctd\u003e$version\u003c/td\u003e\n\t\t\u003ctd\u003eThe string template which is used to generate the tag name. Possible variables are $version and $name. Example: '$name-$version' will result in \"myproject-1.1.0\". (Always ensure to use single-quotes, otherwise `$` is interpreted already in your build script)\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003epreCommitText\u003c/td\u003e\n\t\t\u003ctd\u003e\u003c/td\u003e\n\t\t\u003ctd\u003eThis will be prepended to all commits done by the plugin. A good place for code review, or ticket numbers\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003epreTagCommitMessage\u003c/td\u003e\n\t\t\u003ctd\u003e[Gradle Release Plugin] - pre tag commit: \u003c/td\u003e\n\t\t\u003ctd\u003eThe commit message used to commit the non-SNAPSHOT version if SNAPSHOT was used\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003etagCommitMessage\u003c/td\u003e\n\t\t\u003ctd\u003e[Gradle Release Plugin] - creating tag: \u003c/td\u003e\n\t\t\u003ctd\u003eThe commit message used when creating the tag. Not used with BZR projects\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003enewVersionCommitMessage\u003c/td\u003e\n\t\t\u003ctd\u003e[Gradle Release Plugin] - new version commit:\u003c/td\u003e\n\t\t\u003ctd\u003eThe commit message used when committing the next version\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003esnapshotSuffix\u003c/td\u003e\n\t\t\u003ctd\u003e-SNAPSHOT\u003c/td\u003e\n\t\t\u003ctd\u003eThe version suffix used by the project's version (If used)\u003c/td\u003e\n\t\u003c/tr\u003e\n\u003c/table\u003e\n\nBelow are some properties of the Release Plugin Convention that are specific to version control.\u003cbr\u003e\n\u003ctable\u003e\n\t\u003ctr\u003e\n\t\t\u003cth\u003eVCS\u003c/th\u003e\n\t\t\u003cth\u003eName\u003c/th\u003e\n\t\t\u003cth\u003eDefault value\u003c/th\u003e\n\t\t\u003cth\u003eDescription\u003c/th\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003eGit\u003c/td\u003e\n\t\t\u003ctd\u003erequireBranch\u003c/td\u003e\n\t\t\u003ctd\u003emain\u003c/td\u003e\n\t\t\u003ctd\u003eDefines the branch which releases must be done off of. Eg. set to `release` to require releases are done on the `release` branch (or use a regular expression to allow releases from multiple branches, e.g. `/release|main/`). Set to empty string \"\" to ignore.\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003eGit\u003c/td\u003e\n\t\t\u003ctd\u003ecommitOptions\u003c/td\u003e\n\t\t\u003ctd\u003e{empty}\u003c/td\u003e\n\t\t\u003ctd\u003eDefines an array of options to add to the git adapter during a commit.  Example `commitOptions = [\"-s\"]`\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003eGit\u003c/td\u003e\n\t\t\u003ctd\u003epushOptions\u003c/td\u003e\n\t\t\u003ctd\u003e{empty}\u003c/td\u003e\n\t\t\u003ctd\u003eDefines an array of options to add to the git adapter during a push.  This could be useful to have the vc hooks skipped during a release. Example `pushOptions = [\"--no-verify\"]`\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t    \u003ctd\u003eGit\u003c/td\u003e\n\t    \u003ctd\u003esignTag\u003c/td\u003e\n\t    \u003ctd\u003efalse\u003c/td\u003e\n\t    \u003ctd\u003eAdds `-s` parameter to the tag command\u003c/td\u003e\n\t\u003c/tr\u003e\n\u003c/table\u003e\n\nTo set any of these properties to false, add a \"release\" configuration to your project's ```build.gradle``` file. Eg. To ignore un-versioned files, you would add the following to your ```build.gradle``` file:\n\n```\nrelease {\n  failOnUnversionedFiles = false\n}\n```\n\nEg. To ignore upstream changes, change 'failOnUpdateNeeded' to false:\n\n```\nrelease {\n  failOnUpdateNeeded = false\n}\n```\n\nThis are all possible configuration options and its default values:\n\n``` build.gradle\nrelease {\n    failOnCommitNeeded = true\n    failOnPublishNeeded = true\n    failOnSnapshotDependencies = true\n    failOnUnversionedFiles = true\n    failOnUpdateNeeded = true\n    revertOnFail = true\n    preCommitText = ''\n    preTagCommitMessage = '[Gradle Release Plugin] - pre tag commit: '\n    tagCommitMessage = '[Gradle Release Plugin] - creating tag: '\n    newVersionCommitMessage = '[Gradle Release Plugin] - new version commit: '\n    tagTemplate = '${version}'\n    versionPropertyFile = 'gradle.properties'\n    versionProperties = []\n    snapshotSuffix = '-SNAPSHOT'\n    buildTasks = []\n    ignoredSnapshotDependencies = []\n    versionPatterns = [\n        /(\\d+)([^\\d]*$)/: { Matcher m, Project p -\u003e m.replaceAll(\"${(m[0][1] as int) + 1}${m[0][2]}\") }\n    ]\n    pushReleaseVersionBranch = null\n    scmAdapters = [\n        net.researchgate.release.GitAdapter,\n        net.researchgate.release.SvnAdapter,\n        net.researchgate.release.HgAdapter,\n        net.researchgate.release.BzrAdapter\n    ]\n\n    git {\n        requireBranch.set('main')\n        pushToRemote.set('origin')\n        pushToBranchPrefix.set('')\n        commitVersionFileOnly.set(false)\n        signTag.set(false)\n    }\n\n    svn {\n        username.set(null)\n        password.set(null)\n        pinExternals.set(false)   // allows to pin the externals when tagging, requires subversion client \u003e= 1.9.0\n    }\n}\n```\n\n### Kotlin DSL Example\n\n``` build.gradle.kts\nimport net.researchgate.release.ReleaseExtension\nrepositories {\n    maven {\n      url 'https://plugins.gradle.org/m2/'\n    }\n  }\n  dependencies {\n    classpath 'net.researchgate:gradle-release:3.1.0'\n  }\n\napply(plugin = \"base\")\napply(plugin = \"net.researchgate.release\")\n\nconfigure\u003cReleaseExtension\u003e {\n    ignoredSnapshotDependencies.set(listOf(\"net.researchgate:gradle-release\"))\n    with(git) {\n        requireBranch.set(\"master\")\n        // to disable branch verification: requireBranch.set(null as String?)\n    }\n}\n```\n\n### Custom release steps\n\nTo add a step to the release process is very easy. Gradle provides a very nice mechanism for [manipulating existing tasks](http://gradle.org/docs/current/userguide/tutorial_using_tasks.html#N102B2). There are two available hooks provided: `beforeReleaseBuild` which runs before build and `afterReleaseBuild` which runs afterwards.\n\nFor example, if we wanted to make sure `uploadArchives` is called and succeeds after the build with the release version has finished, we would just add the `uploadArchives` task as a dependency of the `afterReleaseBuild` task:\n\n```groovy\nafterReleaseBuild.dependsOn uploadArchives\n```\n\n### Multi-Project Builds\n\nSupport for [multi-project builds](http://gradle.org/docs/current/userguide/multi_project_builds.html) isn't complete, but will work given some assumptions. The gradle-release plugin assumes and expects that only one version control system is used by both root and sub projects.\n\nApply the plugin separately to each subproject that you wish to release. Release using a qualified task name, e.g.:\n\n```bash\n./gradlew :sub:release # release a subproject named \"sub\"\n./gradlew :release # release the root project\n```\n\n### Working in Continuous Integration\n\nIn a continuous integration environment like Jenkins or Hudson, you don't want to have an interactive release process. To avoid having to enter any information manually during the process, you can tell the plugin to automatically set and update the version number.\n\nYou can do this by setting the `release.useAutomaticVersion` property on the command line, or in Jenkins when you execute gradle. The version to release and the next version can be optionally defined using the properties `release.releaseVersion` and `release.newVersion`.\n\n```bash\ngradle release -Prelease.useAutomaticVersion=true -Prelease.releaseVersion=1.0.0 -Prelease.newVersion=1.1.0-SNAPSHOT\n```\n\n## Getting Help\n\nTo ask questions please use stackoverflow or github issues.\n\n* GitHub Issues: [https://github.com/researchgate/gradle-release/issues/new](https://github.com/researchgate/gradle-release/issues/new)\n* Stack Overflow: [http://stackoverflow.com/questions/tagged/gradle-release-plugin](http://stackoverflow.com/questions/tagged/gradle-release-plugin)\n\nTo report bugs, please use the GitHub project.\n\n* Project Page: [https://github.com/researchgate/gradle-release](https://github.com/researchgate/gradle-release)\n* Reporting Bugs: [https://github.com/researchgate/gradle-release/issues](https://github.com/researchgate/gradle-release/issues)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fresearchgate%2Fgradle-release","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fresearchgate%2Fgradle-release","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fresearchgate%2Fgradle-release/lists"}