JHusky
JHusky copied to clipboard
Java version of https://github.com/typicode/husky/
JHusky
Modern native Git hooks made easy for java environments
JHusky improves your commits and more 🐶 Jwoof!
Install
Include it to your project as a plugin
<build>
<plugins>
<!-- ... Other plugins -->
<plugin>
<groupId>io.github.dathin</groupId>
<artifactId>jhusky</artifactId>
<version>1.0.9</version> <!-- Currently this is the latest version -->
</plugin>
<!-- ... Other plugins -->
</plugins>
<!-- ... Other build configs -->
</build>
Usage
Run install goal once per machine:
mvn jhusky:install -Ddirectory=.husky
Add a hook:
mvn jhusky:add -DhookPath=.husky/pre-commit -Dcommand="mvn clean test"
git add .husky/pre-commit
Make a commit:
git commit -m "Keep calm and commit"
# `mvn clean test` will run
Hooks list
- Check the list with all hooks
Uninstall
If you didn't like it you can just run uninstall goal and remove the plugin
mvn jhusky:uninstall -Ddirectory=.husky
Inspiration
JHusky is a Java version based on Husky for those who don't want/can't use node to setup git hooks in an intuitive and easy way