From 80f19bc1fac0a8465279dc43cd9905f3e86713a0 Mon Sep 17 00:00:00 2001 From: Eric Date: Mon, 22 Apr 2024 11:00:16 +0800 Subject: [PATCH] =?UTF-8?q?:wrench:=20=E8=A1=A5=E9=BD=90=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E5=8F=8Agit=20hook=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .etc/git-hooks/pre-commit | 9 ++++ ballcat-business-bom/pom.xml | 1 - pom.xml | 84 ++++++++++++++++++++++++++++++++++++ 3 files changed, 93 insertions(+), 1 deletion(-) create mode 100755 .etc/git-hooks/pre-commit diff --git a/.etc/git-hooks/pre-commit b/.etc/git-hooks/pre-commit new file mode 100755 index 0000000..633adea --- /dev/null +++ b/.etc/git-hooks/pre-commit @@ -0,0 +1,9 @@ +#!/bin/sh +# 在提交前进行校验 +mvn validate + +# 检查 mvn validate 的退出状态 +if [ $? -ne 0 ]; then + echo "Maven validate failed, aborting commit." + exit 1 +fi \ No newline at end of file diff --git a/ballcat-business-bom/pom.xml b/ballcat-business-bom/pom.xml index 9866fa5..e024b3e 100644 --- a/ballcat-business-bom/pom.xml +++ b/ballcat-business-bom/pom.xml @@ -212,7 +212,6 @@ validate - true validate diff --git a/pom.xml b/pom.xml index aadca76..47341dd 100644 --- a/pom.xml +++ b/pom.xml @@ -144,6 +144,18 @@ + + io.spring.javaformat + spring-javaformat-maven-plugin + + + + validate + + validate + + + org.apache.maven.plugins maven-compiler-plugin @@ -177,6 +189,78 @@ ${maven.compiler.target} + + + org.apache.maven.plugins + maven-surefire-plugin + + -Dfile.encoding=UTF-8 + + + + org.codehaus.mojo + flatten-maven-plugin + + resolveCiFriendliesOnly + true + + + + + flatten + + flatten + process-resources + + + + clean + + flatten.clean + clean + + + + + + com.rudikershaw.gitbuildhook + git-build-hook-maven-plugin + + + + .etc/git-hooks/ + + + + + + + configure + + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + + checkstyle-validation + validate + + src/checkstyle/checkstyle.xml + src/checkstyle/checkstyle-suppressions.xml + true + true + true + + + check + + + +