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