<plugin>
<groupId>io.github.phillipuniverse</groupId>
<artifactId>githook-maven-plugin</artifactId>
<version>1.0.4</version>
<executions>
<execution>
<goals>
<goal>install</goal>
</goals>
<configuration>
<hooks>
<!-- 注意这里是调用shell命令去执行mvn命令,默认生成的hook文件执行路径可能与项目的pom.xml文件不一致,所以我这里用`-f`重新指定了本项目的pom文件路径 -->
<pre-commit>
echo running validation build
exec mvn clean install -f 40_source//你的项目文件夹//pom.xml
</pre-commit>
</hooks>
</configuration>
</execution>
</executions>
</plugin>
install会自动在.git/hook加上对应的hook脚本