From 1555cd94419e410aeaf56a0ace112b6cd71fe57b Mon Sep 17 00:00:00 2001 From: "everywhere.z" Date: Tue, 27 Sep 2022 18:15:19 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E8=8E=B7=E5=8F=96jar?= =?UTF-8?q?=E7=9A=84=E7=89=88=E6=9C=AC=E5=8F=B7=E8=BF=9B=E8=A1=8Cbanner?= =?UTF-8?q?=E7=9A=84=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yomahub/liteflow/util/LOGOPrinter.java | 11 ++++++++++- pom.xml | 12 ++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/util/LOGOPrinter.java b/liteflow-core/src/main/java/com/yomahub/liteflow/util/LOGOPrinter.java index e2cf6fe95..058da4a23 100644 --- a/liteflow-core/src/main/java/com/yomahub/liteflow/util/LOGOPrinter.java +++ b/liteflow-core/src/main/java/com/yomahub/liteflow/util/LOGOPrinter.java @@ -13,7 +13,7 @@ public class LOGOPrinter { /** * LiteFlow 当前版本号 */ - private static final String VERSION_NO = "v2.9.0"; + private static final String VERSION_NO = getVersion(); public static void print() { StringBuilder str = new StringBuilder("\n"); @@ -29,4 +29,13 @@ public class LOGOPrinter { str.append("================================================================================================\n"); LOG.info(str.toString()); } + + private static String getVersion(){ + Package pkg = LOGOPrinter.class.getPackage(); + return (pkg != null) ? pkg.getImplementationVersion() : null; + } + + public static void main(String[] args) { + System.out.println(getVersion()); + } } diff --git a/pom.xml b/pom.xml index a24790d5f..046e63395 100644 --- a/pom.xml +++ b/pom.xml @@ -234,6 +234,18 @@ + + org.apache.maven.plugins + maven-jar-plugin + 3.2.2 + + + + true + + + + org.apache.maven.plugins maven-surefire-plugin