Modern native Git hooks made easy for java environments
JHusky improves your commits and more 🐶 Jwoof!
Include it to your project as a plugin
<build>
<plugins>
<!-- ... Other plugins -->
<plugin>
<groupId>io.github.dathin</groupId>
<artifactId>jhusky</artifactId>
<version>1.0.2</version> <!-- This is the currently latest version -->
</plugin>
<!-- ... Other plugins -->
</plugins>
<!-- ... Other build configs -->
</build>
Run install goal once:
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
- Check the list with all hooks
If you didn't like it you can just run uninstall goal and remove the plugin
mvn jhusky:uninstall
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