{"id":13609303,"url":"https://github.com/dipien/releases-hub-gradle-plugin","last_synced_at":"2025-04-14T12:33:20.211Z","repository":{"id":43840784,"uuid":"196064299","full_name":"dipien/releases-hub-gradle-plugin","owner":"dipien","description":"Gradle Plugin to automatically upgrade your gradle project dependencies and send a GitHub pull request with the changes","archived":false,"fork":false,"pushed_at":"2023-06-27T01:58:12.000Z","size":1630,"stargazers_count":148,"open_issues_count":27,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T01:50:30.083Z","etag":null,"topics":["github","gradle","gradle-plugin","java","kotlin"],"latest_commit_sha":null,"homepage":"https://releaseshubplugin.dipien.com","language":"Kotlin","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/dipien.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"patreon":"dipien","ko_fi":"maxirosson","custom":["http://alby.dipien.com"]}},"created_at":"2019-07-09T18:43:54.000Z","updated_at":"2024-06-27T13:01:18.000Z","dependencies_parsed_at":"2024-01-16T23:31:07.549Z","dependency_job_id":"7c0e2426-1f23-48a7-9d77-a0c6aac3211b","html_url":"https://github.com/dipien/releases-hub-gradle-plugin","commit_stats":null,"previous_names":["releaseshub/releases-hub-gradle-plugin"],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dipien%2Freleases-hub-gradle-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dipien%2Freleases-hub-gradle-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dipien%2Freleases-hub-gradle-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dipien%2Freleases-hub-gradle-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dipien","download_url":"https://codeload.github.com/dipien/releases-hub-gradle-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248881924,"owners_count":21176945,"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":["github","gradle","gradle-plugin","java","kotlin"],"created_at":"2024-08-01T19:01:33.983Z","updated_at":"2025-04-14T12:33:20.169Z","avatar_url":"https://github.com/dipien.png","language":"Kotlin","funding_links":["https://patreon.com/dipien","https://ko-fi.com/maxirosson","http://alby.dipien.com"],"categories":["Kotlin"],"sub_categories":[],"readme":"[![Dipien](https://raw.githubusercontent.com/dipien/dipien-component-builder/master/.github/dipien_logo.png)](http://www.dipien.com)\n\n# Releases Hub Gradle Plugin\nGradle Plugin to automatically upgrade your Java/Kotlin project dependencies and send a GitHub pull request with the changes.\n\nYou can read [this](https://medium.com/dipien/automate-dependencies-upgrades-with-releases-hub-8eac6d7f43d6) blog post for more detailed information.\n\n## How it works\n\n1. Apply and configure the plugin according to your needs\n2. Invoke the `upgradeDependencies` task on your CI tool (daily, weekly, monthly, as you wish)\n3. If any of your dependencies is out-of-date, the plugin will create a pull request to update it.\n4. Verify that your PR CI checks pass, scan the included release notes, perform manual tests, and merge the PR.\n\n## Features\n* Automatic Pull Request creation, including useful information whenever available:\n  * new version release notes link\n  * library documentation link\n  * library source code link\n  * library issue tracker link\n  * library size\n  * new permissions added by the library (only for android libraries)\n* Support to configure which dependencies include and exclude, where to find their definitions, how many pull requests create and more.\n* Support any Java/Kotlin project using Gradle.\n\n![](wiki/pull_request.png)\n\n## Setup\n\nAdd the following configuration to your root `build.gradle`, replacing X.Y.Z by the [latest version](https://github.com/dipien/releases-hub-gradle-plugin/releases/latest)\n\nUsing the plugins DSL + Groovy:\n\n```groovy\nplugins {\n  id \"com.dipien.releaseshub.gradle.plugin\" version \"X.Y.Z\"\n}\n```\n\n\nUsing the plugins DSL + Kotlin DSL:\n\n```kotlin\nplugins {\n  id(\"com.dipien.releaseshub.gradle.plugin\").version(\"X.Y.Z\")\n}\n```\n\nUsing legacy plugin application + Groovy:\n\n```groovy\nbuildscript {\n    repositories {\n        mavenCentral()\n    }\n    dependencies {\n        classpath(\"com.dipien:releases-hub-gradle-plugin:X.Y.Z\")\n    }\n}\n    \napply plugin: \"com.dipien.releaseshub.gradle.plugin\"\n```\n\nUsing legacy plugin application + Kotlin DSL:\n\n```kotlin\nbuildscript {\n    repositories {\n        mavenCentral()\n    }\n    dependencies {\n        classpath(\"com.dipien:releases-hub-gradle-plugin:X.Y.Z\")\n    }\n}\n    \napply(plugin = \"com.dipien.releaseshub.gradle.plugin\")\n```\n\n## Configure\n\n#### How to configure the properties\n\nAll the plugin configuration properties can be added using any of the following ways:\n\n* Using the `releasesHub` extension on the build.gradle. For example:\n```groovy\nreleasesHub {\n    gitHubRepository = \"sample\"\n}\n```\n* As a command line parameter. For example:\n```\n./gradlew listDependencies -PgitHubRepository=sample\n```\n* As a property on a `gradle.properties` file. For example:\n```\ngitHubRepository = \"sample\"\n```\n* As an extra property on the build.gradle. For example:\n```\next.gitHubRepository = \"sample\"\n```\n* As a System Environment property\n\n#### Common Properties\n\n###### Auto Detect Dependencies paths\n\nWhether the plugin should automatically find the files where the dependencies are defined. This property is required. The default value is true\n\n    autoDetectDependenciesPaths = true\n\nThe plugin automatically find dependencies on the following files:\n* buildSrc/src/main/kotlin/Libs.kt\n* buildSrc/src/main/kotlin/BuildLibs.kt\n* gradle/libs.versions.toml\n* settings.gradle.kts\n* settings.gradle\n* Any build.gradle or build.gradle.kts file on the root project and all the subprojects\n\n###### Dependencies paths\n\nThe custom paths (relative to the project root directory) for the files where the dependencies are defined. This list is used in addition to the auto detected paths (if enabled). This property is optional. For example:\n\n    dependenciesPaths = [\n      \"dependencies.gradle.kts\", \n    ]\n    \n###### Includes\n\nThe dependencies to include. \nYou can define a `groupId` to match all the artifacts for that group id, or `groupId:artifactId` to match a particular artifact.\nBy default all the dependencies found on `dependenciesClassNames` are included.\n\n    includes = [\"com.groupid1\", \"com.groupid2:artifact1\"]\n    \n###### Excludes\n\nThe dependencies to exclude. \nYou can define a `groupId` to match all the artifacts for that group id, or `groupId:artifactId` to match a particular artifact.\nBy default there aren't excluded dependencies.\n\n    excludes = [\"com.groupid1\", \"com.groupid2:artifact1\"]\n    \nIf you need to exclude the Gradle upgrade, use \"gradle\". For example: \n\n    excludes = [\"gradle\"]\n\n## Usage\n\n### Version Catalog (libs.versions.toml file) example\n\nYou can define your dependencies on the `libs.versions.toml` version catalog.\n\n##### gradle/libs.versions.toml\n\n```\n[libraries]\nkotlin = \"org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.40\"\nkotlin-plugin = \"org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.41\"\n```\n\n##### Root build.gradle\n\n```groovy\nbuildscript {\n    dependencies {\n        classpath(libs.kotlin.plugin)\n    }\n}\n\ndependencies {\n    implementation(libs.kotlin)\n}\n\napply plugin: \"kotlin\"\napply plugin: \"com.dipien.releaseshub.gradle.plugin\"\n```\n\n### Version Catalog (settings.gradle.kts file) example\n\nYou can define your dependencies on the `settings.gradle.kts` version catalog.\n\n##### settings.gradle.kts\n\n```\ndependencyResolutionManagement {\n    versionCatalogs {\n        create(\"libs\") {\n            alias(\"kotlin\").to(\"org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.40\")\n            alias(\"kotlin-plugin\").to(\"org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.41\")\n        }\n    }\n}\n```\n\n##### Root build.gradle\n\n```groovy\nbuildscript {\n    dependencies {\n        classpath(libs.kotlin.plugin)\n    }\n}\n\ndependencies {\n    implementation(libs.kotlin)\n}\n\napply plugin: \"kotlin\"\napply plugin: \"com.dipien.releaseshub.gradle.plugin\"\n```\n\n### BuilsSrc example\n\nYou can define your dependencies on `/buildSrc/src/main/kotlin/Libs.kt` and `/buildSrc/src/main/kotlin/BuildLibs.kt` classes.\n\n##### buildSrc/src/main/kotlin/Libs.kt\n\n```kotlin\nobject Libs {\n    const val KOTLIN = \"org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.40\"\n}\n```\n\n##### buildSrc/src/main/kotlin/BuildLibs.kt\n\n```kotlin\nobject BuildLibs {\n    const val KOTLIN_PLUGIN = \"org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.41\"\n}\n```\n\n##### Root build.gradle\n\n```groovy\nbuildscript {\n    dependencies {\n        classpath(BuildLibs.KOTLIN_PLUGIN)\n    }\n}\n\ndependencies {\n    implementation(Libs.KOTLIN)\n}\n\napply plugin: \"kotlin\"\napply plugin: \"com.dipien.releaseshub.gradle.plugin\"\n```\n\nSee the [sample](https://github.com/dipien/releases-hub-gradle-plugin/tree/master/sample) for more details.\n\nTo automate your dependencies upgrades, you can follow this guide: [How to automate your dependencies upgrades with GitHub Actions](https://blog.dipien.com/how-to-automate-your-dependencies-upgrades-with-github-actions-bedf1337ca3f)\n\n### Tasks\n\n#### Validate dependencies\n\nValidate all the dependencies.\nThe following validations are executed:\n\n* All the dependencies defined on each `dependenciesPaths` are sorted alphabetically by `groupId:artifactId`\n* There are not duplicated dependencies defined on each `dependenciesPaths`\n* There are not dependencies with snapshot or dynamic versions assigned\n* There are dependencies on `dependenciesPaths` but not used on the project\n* There are dependencies explicitly declared on a .gradle(.kts) file instead of using buildSrc or Version Catalog.\n\n```\n./gradlew validateDependencies\n```\n##### Properties\n\n###### Unused Excludes\n\nThe dependencies to exclude from the unused validation. \nYou can define a `groupId` to match all the artifacts for that group id, or `groupId:artifactId` to match a particular artifact.\nBy default there aren't excluded dependencies.\n\n    unusedExcludes = [\"com.groupid1\", \"com.groupid2:artifact1\"]\n    \n###### Unused extensions to search\n\nThe file extensions of the files where the artifact's packages will we search to find unused dependendencies. \nBy default `[\".kt\", \".java\", \".xml\"]`\n\n    unusedExtensionsToSearch = [\".kt\", \".java\"]\n\n#### List dependencies\n\nPrint all the dependencies that will be analyzed to upgrade.\n\n    ./gradlew listDependencies\n    \n    \n#### List dependencies to upgrade\n\nPrint all the dependencies that are upgradeable. A file `build/releasesHub/dependencies_to_upgrade_count.txt` is generated with the count of dependencies that are upgradeable. This could be useful for metrics.\n\n    ./gradlew listDependenciesToUpgrade\n\n#### Upgrade dependencies\n\nThis task creates a Github Pull Request for each groupId that have at least one dependency to upgrade. \n\nThe following steps are executed for each `groupId`: \n\n* Creates the `headBranch` (`headBranchPrefix` + `groupId`)  (if not exists)\n* Merge from the `baseBranch` to the `headBranch`\n* Upgrade all the dependencies defined on the `dependenciesClassNames` for the `groupId`\n* Create a commit for each dependency upgraded\n* Push the previous commits to the `headBranch`\n* Create a GitHub pull request from the `headBranch` to the `baseBranch`\n\n```\n./gradlew upgradeDependencies\n```\n\n##### Properties\n\n###### Pull Request Enabled\n\nWhether a pull request with all the upgrades should be created or not. The default value is `true`\n\n    pullRequestEnabled = false\n\n###### Pull Requests Max\n\nThe maximum amount of pull requests to create during the task execution. \nThis is useful to avoid creating too much pull requests when you still have many dependencies to upgrade. The default value is `5`\n\n    pullRequestsMax = 10\n    \n###### Pull Request Labels\n\nThe list of labels to assign when creating the pull request. Optional list.\n\n    pullRequestLabels = [\"dependencies\"]\n\n###### Pull Request Assignee\n\nThe user to be assigned to the pull request. Optional string.\n\n    pullRequestAssignee = \"octocat\"\n    \n###### Pull Request Reviewers\n\nThe list of reviewers to assign when creating the pull request. Optional list.\n\n    pullRequestReviewers = [\"octocat\", \"hubot\", \"other_user\"]\n    \n###### Pull Request Team Reviewers\n\nThe list of team reviewers to assign when creating the pull request. Optional list.\n\n    pullRequestTeamReviewers = [\"justice-league\"]\n\n###### Head Branch Prefix\n\nThe branch's prefix where the commit will be pushed. Also, the head branch's prefix of the pull request to create. Required String (only if `pullRequestEnabled` is `true`). The default value is `releases_hub/`.\n\n    headBranchPrefix = \"branch_name_\"\n\n###### Base Branch\n\nThe pull request base branch. Optional String. The default value is `master`.\n\n    baseBranch = \"master\"\n\n###### Git User Name\n\nThe Git user name used by the commit command. Optional String.\n\n    gitUserName = \"user\"\n    \n###### Git User Email\n\nThe Git user email used by the commit command. Optional String.\n\n    gitUserEmail = \"email@mail.com\"\n\n###### GitHub Repository\n\nThe GitHub repository where the pull request will be created. Required String (only if `pullRequestEnabled` is `true`).\n\n    gitHubRepository = \"repo_owner/repo_name\"\n\n###### GitHub Repository Owner\n\nThe GitHub repository owner where the pull request will be created. Required String (only if `pullRequestEnabled` is `true` \u0026 `gitHubRepository` was not defined).\n\n    gitHubRepositoryOwner = \"repo_owner\"\n\n###### GitHub Repository Name\n\nThe GitHub repository name where the pull request will be created. Required String (only if `pullRequestEnabled` is `true` \u0026 `gitHubRepository` was not defined).\n\n    gitHubRepositoryName = \"repo_name\"\n\n###### GitHub Write Token\n\nThe GitHub write token needed to access the GitHub API to create the pull request. Follow these [steps](https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token) to create your token.\nWe strongly recommend to not use the `releasesHub` extension for this property, to avoid exposing it on the git repository.\nRequired String (only if `pullRequestEnabled` is `true`).\n\n    gitHubWriteToken = \"123\"\n\n\n###### GitHub Api Host Name\n\nThe GitHub api host name needed to access the GitHub Enterprise. Optional String.\n\n    gitHubApiHostName = \"your.githubenterprise.com\"\n\n\n## Versioning\n\nThis project uses the [Semantic Versioning guidelines](http://semver.org/) for transparency into our release cycle.\n\n## Sponsor this project\n\nSponsor this open source project to help us get the funding we need to continue working on it.\n\n* [Donate with Bitcoin Lightning](https://getalby.com/p/dipien) ⚡️ [dipien@getalby.com](https://getalby.com/p/dipien)\n* [Donate with credit card](http://kofi.dipien.com/)\n* [Donate on Patreon](http://patreon.dipien.com/)\n* [Become a member of Medium](https://membership.medium.dipien.com) [We will receive a portion of your membership fee]\n\n## Follow us\n* [Twitter](http://twitter.dipien.com)\n* [Medium](http://medium.dipien.com)\n* [Instagram](http://instagram.dipien.com)\n* [TikTok](https://tiktok.dipien.com)\n* [Pinterest](http://pinterest.dipien.com)\n* [GitHub](http://github.dipien.com)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdipien%2Freleases-hub-gradle-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdipien%2Freleases-hub-gradle-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdipien%2Freleases-hub-gradle-plugin/lists"}