mirror of
https://gitee.com/dromara/Jpom.git
synced 2024-12-03 20:38:52 +08:00
fix code style
This commit is contained in:
parent
ab28bcfff4
commit
77bc0d4f64
@ -1,11 +1,10 @@
|
||||
package io.jpom;
|
||||
|
||||
import cn.jiangzeyin.common.DefaultSystemLog;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import io.jpom.common.JpomManifest;
|
||||
import io.jpom.util.VersionUtils;
|
||||
import org.springframework.boot.context.event.ApplicationReadyEvent;
|
||||
import org.springframework.boot.context.logging.LoggingApplicationListener;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.core.annotation.Order;
|
||||
|
||||
/**
|
||||
* @author Hotstrip
|
||||
@ -29,13 +28,17 @@ public class JpomLogo implements ApplicationListener<ApplicationReadyEvent> {
|
||||
" | | \n" +
|
||||
" |_| \n";
|
||||
|
||||
/**
|
||||
* @return jpom logo banner
|
||||
* @see JpomManifest#getVersion()
|
||||
*/
|
||||
private String buildBannerText() {
|
||||
String LINE_SEPARATOR = System.getProperty("line.separator");
|
||||
return LINE_SEPARATOR
|
||||
String lineSeparator = FileUtil.getLineSeparator();
|
||||
return lineSeparator
|
||||
+ JPOM_LOGO
|
||||
+ LINE_SEPARATOR
|
||||
+ " :: Jpom :: (v"+ VersionUtils.getVersion(getClass(), "2.4.8") +")"
|
||||
+ LINE_SEPARATOR;
|
||||
+ lineSeparator
|
||||
+ " :: Jpom :: (v" + VersionUtils.getVersion(getClass(), "2.4.8") + ")"
|
||||
+ lineSeparator;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ import io.jpom.system.ConfigBean;
|
||||
import io.jpom.system.JpomRuntimeException;
|
||||
import io.jpom.util.CommandUtil;
|
||||
import io.jpom.util.JsonFileUtil;
|
||||
import io.jpom.util.VersionUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
@ -72,6 +73,7 @@ public class JpomManifest {
|
||||
File jarFile = getRunPath();
|
||||
if (jarFile.isFile()) {
|
||||
try (JarFile jarFile1 = new JarFile(jarFile)) {
|
||||
// @see VersionUtils#getVersion()
|
||||
Manifest manifest = jarFile1.getManifest();
|
||||
Attributes attributes = manifest.getMainAttributes();
|
||||
String version = attributes.getValue(Attributes.Name.IMPLEMENTATION_VERSION);
|
||||
@ -111,6 +113,12 @@ public class JpomManifest {
|
||||
this.pid = pid;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前运行的版本号
|
||||
*
|
||||
* @return 返回当前版本号
|
||||
* @see VersionUtils#getVersion()
|
||||
*/
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user