Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pepperkit/git-hooks-maven-plugin
Maven plugin for easy git hooks configuration.
https://github.com/pepperkit/git-hooks-maven-plugin
git git-hooks java maven maven-plugin
Last synced: 22 days ago
JSON representation
Maven plugin for easy git hooks configuration.
- Host: GitHub
- URL: https://github.com/pepperkit/git-hooks-maven-plugin
- Owner: pepperkit
- License: mit
- Created: 2021-11-22T07:06:09.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2024-04-02T07:39:47.000Z (8 months ago)
- Last Synced: 2024-10-15T20:23:17.326Z (30 days ago)
- Topics: git, git-hooks, java, maven, maven-plugin
- Language: Java
- Homepage:
- Size: 93.8 KB
- Stars: 4
- Watchers: 0
- Forks: 1
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Git Hooks Maven Plugin
[![Java CI with Maven](https://github.com/pepperkit/git-hooks-maven-plugin/actions/workflows/maven.yml/badge.svg?branch=master)](https://github.com/pepperkit/git-hooks-maven-plugin/actions/workflows/maven.yml)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=pepperkit_git-hooks-maven-plugin&metric=coverage)](https://sonarcloud.io/dashboard?id=pepperkit_git-hooks-maven-plugin)
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=pepperkit_git-hooks-maven-plugin&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=pepperkit_git-hooks-maven-plugin)
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=pepperkit_git-hooks-maven-plugin&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=pepperkit_git-hooks-maven-plugin)
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=pepperkit_git-hooks-maven-plugin&metric=security_rating)](https://sonarcloud.io/dashboard?id=pepperkit_git-hooks-maven-plugin)Maven plugin for easy git hooks configuration.
## Usage
Add the plugin into your `pom.xml`, configure the hooks, and set the execution to install the hooks each time
the project is rebuild. Be aware that for hooks to be installed to git, any `mvn` goal should be first executed,
like `compile` or `test`. It means that after editing git-hooks-maven-plugin configuration in `pom.xml`,
it's necessary to manually run `mvn compile` or any other maven goal, on the initializing step of which git hooks will be installed.The example with *pre-commit* and *pre-push* hooks configured, will look like this:
```xml
io.github.pepperkit
git-hooks-maven-plugin
1.1.0
initHooks
mvn -B checkstyle:checkstyle
mvn -B test
```
Hook's content is any command line script, which is considered successful if exit code is equal to `0`, and not otherwise.
If execution of the script is successful, git action will be proceeded, if not - it will be cancelled.## Project's structure
```
└── src
├── main # code of the plugin
├── test # unit tests
└── system-test # system tests
└── resources # system tests scenarios and pre-configured pom files needed for the tests
```More about pepperkit projects could be found on its website: https://pepperkit.github.io/