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: about 1 year 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 (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-04-02T07:39:47.000Z (about 2 years ago)
- Last Synced: 2025-05-07T04:46:15.635Z (about 1 year 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
[](https://github.com/pepperkit/git-hooks-maven-plugin/actions/workflows/maven.yml)
[](https://sonarcloud.io/dashboard?id=pepperkit_git-hooks-maven-plugin)
[](https://sonarcloud.io/dashboard?id=pepperkit_git-hooks-maven-plugin)
[](https://sonarcloud.io/dashboard?id=pepperkit_git-hooks-maven-plugin)
[](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/