{"id":22379139,"url":"https://github.com/sky-uk/gradle-maven-plugin","last_synced_at":"2025-08-23T19:10:26.079Z","repository":{"id":46862511,"uuid":"190592720","full_name":"sky-uk/gradle-maven-plugin","owner":"sky-uk","description":"Gradle 5.x Maven Publish Plugin to deploy artifacts","archived":false,"fork":false,"pushed_at":"2023-07-09T11:18:44.000Z","size":22,"stargazers_count":130,"open_issues_count":3,"forks_count":39,"subscribers_count":11,"default_branch":"master","last_synced_at":"2023-11-07T16:26:01.625Z","etag":null,"topics":["5","aar","android","artifact","gradle","library","maven","plugin"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sky-uk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-06T14:10:01.000Z","updated_at":"2023-04-28T15:57:22.000Z","dependencies_parsed_at":"2022-09-23T08:00:22.238Z","dependency_job_id":null,"html_url":"https://github.com/sky-uk/gradle-maven-plugin","commit_stats":null,"previous_names":[],"tags_count":8,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sky-uk%2Fgradle-maven-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sky-uk%2Fgradle-maven-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sky-uk%2Fgradle-maven-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sky-uk%2Fgradle-maven-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sky-uk","download_url":"https://codeload.github.com/sky-uk/gradle-maven-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228204605,"owners_count":17884711,"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":["5","aar","android","artifact","gradle","library","maven","plugin"],"created_at":"2024-12-04T23:09:05.852Z","updated_at":"2024-12-04T23:09:06.541Z","avatar_url":"https://github.com/sky-uk.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gradle Maven Plugin\nThis is a small \"plugin\" to simplify the use of *maven-publish* Gradle plugin. \nYou can use this plugin for Java Library and Android Library.\n\n# Index\n\n* [Usage](#usage)\n* [Customization](#customization)\n    * [Generic Project Info](#genericInfo)\n    * [Repositories](#repositories)\n    * [Example of per-module costumization](#examplePerModule)\n* [Library Publish](#publishCommand)\n* [Maven Central Publish](#maven-central-publish)\n* [Generate POM file](#pomGeneration)\n\n## \u003ca name=\"usage\"/\u003eUsage\nIn order to use GradleMavenizer you have to add the line\n\n`apply from: 'https://raw.githubusercontent.com/sky-uk/gradle-maven-plugin/master/gradle-mavenizer.gradle'`\n\nat the \u003cb\u003every bottom\u003c/b\u003e of the *build.gradle* file. Alternatively, to use a specific release version, add this property to the project (see Releases at the top of the Github page for released versions):\n\n    mavPluginVersion = '1.2.0'\n    \nand add this line to the very bottom of the *build.gradle* file:\n\n    apply from: \"https://raw.githubusercontent.com/sky-uk/gradle-maven-plugin/${project.mavPluginVersion}/gradle-mavenizer.gradle\"`\n\n## \u003ca name=\"customization\"/\u003eCustomization\nGradleMavenizer is highly customizable.\n\nYou can customize it adding some properties to the root project *build.gradle* or to the module *build.gradle* file.\n\n_\u003cb\u003eAttention:\u003c/b\u003e If you add the same property to the root project file and to the module file, in order of priority, the module file property will override the root project property._\n\n### \u003ca name=\"genericInfo\"/\u003e1. Generic Project Info (included in POM)\n\n* \u003cb\u003emavProjectName\u003c/b\u003e _-\u003e String property -\u003e Identify the project name (can be different from the artifactId)_\n* \u003cb\u003emavLibraryDescription\u003c/b\u003e _-\u003e String property -\u003e A simple description for the library_\n* \u003cb\u003emavDevelopers\u003c/b\u003e _-\u003e Map property -\u003e A map with the ids and the developer name of the library_\n* \u003cb\u003emavLibraryLicenses\u003c/b\u003e _-\u003e Map property -\u003e A map with the name and the urls of the library licenses_\n* \u003cb\u003emavSiteUrl\u003c/b\u003e _-\u003e String property -\u003e Identify the url of the project website_\n* \u003cb\u003emavGitUrl\u003c/b\u003e _-\u003e String property -\u003eIdentify the url of the project github page_\n\n### \u003ca name=\"repositories\"/\u003e2. Repositories\n\n* Remote repository:\n    * \u003cb\u003emavPublishToRemoteRepo\u003c/b\u003e _-\u003e Boolean property -\u003e Allow the script to load your library to a remote repo_\n    * \u003cb\u003emavRemoteRepoUser\u003c/b\u003e _-\u003e String property -\u003e Username to grant access to the remote repo_\n    * \u003cb\u003emavRemoteRepoPassword\u003c/b\u003e _-\u003e String property -\u003e Password to grant access to the remote repo_\n    * \u003cb\u003emavRepoRemoteUrl\u003c/b\u003e _-\u003e String property -\u003e Identify the url of the remote repo_\n    \n* Internal repository:\n    * \u003cb\u003emavPublishToInternalRepo\u003c/b\u003e _-\u003e Boolean property -\u003e Allow the script to load your library to an internal repo_\n    * \u003cb\u003emavRepoInternalUrl\u003c/b\u003e _-\u003e String property -\u003e Identify the url of the internal repo_\n    \n* MavenLocal repository:\n    * \u003cb\u003emavPublishToMavenLocal\u003c/b\u003e _-\u003e Boolean property -\u003e Allow the script to load your library to MavenLocal folder_\n    \n_\u003cb\u003eAttention:\u003c/b\u003e If you won't set any repository automatically the script will use MavenLocal as default repo_\n\n### \u003ca name=\"examplePerModule\"/\u003eExample of per-module _build.gradle_ costumization\n\n```\nproject.ext {\n    mavDevelopers = [\"Fe\":\"Federico\"]\n    mavSiteUrl = \"https://github.com/sky-uk/gradle-maven-plugin\"\n    mavGitUrl = mavSiteUrl + '.git'\n    mavProjectName = 'GradleMavenizer'\n    mavPublishToInternalRepo = true\n    mavRepoInternalUrl = \"path/to/internal/repo\"\n    mavLibraryLicenses = [\"Apache-2.0\":'http://www.apache.org/licenses/LICENSE-2.0.txt']\n    mavLibraryDescription = \"A simple description of the project\"\n}\n```\n\n## \u003ca name=\"publishCommand\"/\u003eLibrary Publish\nTo finally publish you library you can use the command `./gradlew publish` directly from your project root folder.\n\nYou can also pass some properties directly from command line using the command `-P` (every property must have `-P` before), for example:\n`./gradlew publish -PmavPublishToMavenLocal=true`\n\n## \u003ca name=\"publishCommand\"/\u003eMaven Central Publish\nFollow [this guide](https://getstream.io/blog/publishing-libraries-to-mavencentral-2021/?s=09) if you need to get a Sonatype account and generate a GPG key. Those matters are out of scope here.\n\nIn your project root, add `local.properties` (make sure to ignore it in your repo and not commit it) with the following content:\n```groovy\nsigning.keyId=ABCDEFGH\nsigning.password=yourPassword\nsigning.secretKeyRingFile=/path/to/ABCDEFGH.gpg\n\nmavRepoRemoteUrl=https://oss.sonatype.org/service/local/staging/deploy/maven2/\nmavRemoteRepoUser=yourSonatypeUsername\nmavRemoteRepoPassword=yourSonatypePassword\n```\nThen to publish a staging repository on [Maven Central](https://oss.sonatype.org) execute:\n\n```\n./gradlew publish -PmavSigning=true -PmavPublishToRemoteRepo=true --max-workers 1\n```\nThe `--max-workers 1` setting is important to ensure the publication does not get split in multiple publications when using gradle parallel builds, resulting in many stagng repositories on sonatype. It's always advised to specify it.\n\nAfter you executed the command, you can browse and review what's been uploaded by visiting https://oss.sonatype.org/#stagingRepositories\n\n## \u003ca name=\"pomGeneration\"/\u003eGenerate POM file\nIf you want to generate the POM file without publish your library you can use the command `./gradlew generatePomFileForMavenPublishPublication` directly from your project root folder.\n\nTo generate the POM file only for one module of your library you can use the command `./gradlew your-module-name:generatePomFileForMavenPublishPublication` where you have to replace `your-module-name` with the name you chose for your module.\n\n_Note: POM file will be saved in `build/publications/mavenPublish/` as `pom-default.xml`_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsky-uk%2Fgradle-maven-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsky-uk%2Fgradle-maven-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsky-uk%2Fgradle-maven-plugin/lists"}