mirror of
https://gitee.com/dromara/liteFlow.git
synced 2026-05-15 04:22:09 +08:00
自动获取jar的版本号进行banner的打印
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
12
pom.xml
12
pom.xml
@@ -234,6 +234,18 @@
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.2.2</version>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifest>
|
||||
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
|
||||
</manifest>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
|
||||
Reference in New Issue
Block a user