{"id":13734470,"url":"https://github.com/ksoichiro/gradle-build-info-plugin","last_synced_at":"2025-04-12T05:37:20.186Z","repository":{"id":57720846,"uuid":"47978845","full_name":"ksoichiro/gradle-build-info-plugin","owner":"ksoichiro","description":"Gradle plugin to include build information such as Git commit ID to your JAR. It can be used to show Git commit information with Spring Boot Actuator.","archived":false,"fork":false,"pushed_at":"2017-01-02T08:07:48.000Z","size":109,"stargazers_count":37,"open_issues_count":3,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-26T01:03:23.436Z","etag":null,"topics":["gradle","gradle-plugin","java","spring-boot"],"latest_commit_sha":null,"homepage":"","language":"Groovy","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/ksoichiro.png","metadata":{"files":{"readme":"README.md","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":"2015-12-14T14:09:48.000Z","updated_at":"2024-09-28T17:58:29.000Z","dependencies_parsed_at":"2022-08-25T15:03:06.709Z","dependency_job_id":null,"html_url":"https://github.com/ksoichiro/gradle-build-info-plugin","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksoichiro%2Fgradle-build-info-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksoichiro%2Fgradle-build-info-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksoichiro%2Fgradle-build-info-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksoichiro%2Fgradle-build-info-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ksoichiro","download_url":"https://codeload.github.com/ksoichiro/gradle-build-info-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248525164,"owners_count":21118616,"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","gradle-plugin","java","spring-boot"],"created_at":"2024-08-03T03:00:56.132Z","updated_at":"2025-04-12T05:37:20.132Z","avatar_url":"https://github.com/ksoichiro.png","language":"Groovy","funding_links":[],"categories":["Plugins"],"sub_categories":["Packaging"],"readme":"# gradle-build-info-plugin\n\n[![Build Status](https://img.shields.io/travis/ksoichiro/gradle-build-info-plugin/master.svg?style=flat-square)](https://travis-ci.org/ksoichiro/gradle-build-info-plugin)\n[![Build status](https://img.shields.io/appveyor/ci/ksoichiro/gradle-build-info-plugin/master.svg?style=flat-square)](https://ci.appveyor.com/project/ksoichiro/gradle-build-info-plugin)\n[![Coverage Stagus](https://img.shields.io/coveralls/ksoichiro/gradle-build-info-plugin/master.svg?style=flat-square)](https://coveralls.io/github/ksoichiro/gradle-build-info-plugin?branch=master)\n[![Bintray](https://img.shields.io/bintray/v/ksoichiro/maven/gradle-build-info-plugin.svg?style=flat-square)](https://bintray.com/ksoichiro/maven/gradle-build-info-plugin/_latestVersion)\n[![Maven Central](http://img.shields.io/maven-central/v/com.github.ksoichiro/gradle-build-info-plugin.svg?style=flat-square)](https://github.com/ksoichiro/gradle-build-info-plugin/releases/latest)\n\n\u003e Gradle plugin to include build information such as Git commit ID to your JAR.\n\n## Usage\n\nApply plugin:\n\n```gradle\nplugins {\n    id 'com.github.ksoichiro.build.info' version '0.2.0'\n}\n```\n\nNote that you can use this plugin only when you use java plugin because you build JAR:\n\n```gradle\napply plugin: 'java'\n```\n\nWhen used with Spring Boot Actuator dependency, this plugin will also generate\n`git.properties`, which will be recognized by Spring Boot Actuator's\ninfo endpoint.\n\nThen just build your project:\n\n```console\n$ ./gradlew build\n```\n\nNow your Manifest in JAR includes special attributes:\n\n```console\n$ unzip -p build/libs/yourJar.jar META-INF/Manifest.MF\nManifest-Version: 1.0\nGit-Branch: master\nGit-Commit: 154f026\nGit-Committer-Date: 2015-12-17 20:05:55 +0900\nBuild-Date: 2015-12-17 20:15:15 +0900\nBuild-Java-Version: 1.8.0_45\nBuild-Java-Vendor: Oracle Corporation\nBuild-Os-Name: Mac OS X\nBuild-Os-Version: 10.10.1\n```\n\nAnd when Spring Boot Actuator is used with it, git.properties\nwill be generated:\n\n```console\n$ cat build/resources/main/git.properties\ngit.branch=master\ngit.commit.id=38a0c0c\ngit.commit.time=2015-12-16 23\\:40\\:13 +0900\n```\n\n## Configuration\n\nYou can configure this plugin with `buildInfo` extension in build.gradle:\n\n```gradle\nbuildInfo {\n    // Date format string used to Git committer date.\n    committerDateFormat 'yyyy-MM-dd HH:mm:ss Z'\n\n    // Date format string used to build date.\n    buildDateFormat 'yyyy-MM-dd HH:mm:ss Z'\n\n    // Set to true if you want to generate/merge Manifest.MF.\n    manifestEnabled true\n\n    // Set to true if you want to generate git.properties.\n    // Default is false, but when you use Spring Boot Actuator\n    // and you don't set this property explicitly to false,\n    // git.properties will be generated.\n    gitPropertiesEnabled false\n\n    // Behavior when the plugin cannot read .git directory.\n    // Set to MODE_IGNORE if you want to ignore it and proceed task.\n    // Set to MODE_ERROR if you want to throw an exception to stop build.\n    // Default is MODE_DEFAULT.\n    // MODE_DEFAULT will set the values of branch, commit,\n    // and committer date to \"unknown\", then proceed task.\n    gitInfoMode com.github.ksoichiro.build.info.BuildInfoExtension.MODE_DEFAULT\n\n    // Set to false if you want to suppress log when .git directory\n    // cannot be read.\n    // Default is true.\n    warnIfGitDirectoryIsMissing false\n\n    // Set to false if you want to exclude some attributes\n    // from the manifest file.\n    // All properties are true by default.\n    attributeGitBranchEnabled false\n    attributeGitCommitEnabled false\n    attributeGitCommitterDateEnabled false\n    attributeBuildDateEnabled false\n    attributeBuildJavaVersionEnabled false\n    attributeBuildJavaVendorEnabled false\n    attributeBuildOsNameEnabled false\n    attributeBuildOsVersionEnabled false\n}\n```\n\n## License\n\n    Copyright 2015 Soichiro Kashima\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n        http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fksoichiro%2Fgradle-build-info-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fksoichiro%2Fgradle-build-info-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fksoichiro%2Fgradle-build-info-plugin/lists"}