Commit d61e5236 authored by kl's avatar kl

新增启动完成,打印启动耗时、演示页访问地址

parent d514e6dc
package cn.keking; package cn.keking;
import org.springframework.boot.SpringApplication; import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.util.StopWatch;
@SpringBootApplication @SpringBootApplication
@EnableScheduling @EnableScheduling
@ComponentScan(value = "cn.keking.*") @ComponentScan(value = "cn.keking.*")
public class ServerMain { public class ServerMain {
private static final Logger logger = LoggerFactory.getLogger(ServerMain.class);
public static void main(String[] args) { public static void main(String[] args) {
StopWatch stopWatch = new StopWatch();
stopWatch.start();
ServerMain.staticInitSystemProperty(); ServerMain.staticInitSystemProperty();
SpringApplication.run(ServerMain.class, args); new SpringApplicationBuilder(ServerMain.class)
.logStartupInfo(false)
.run(args);
stopWatch.stop();
logger.info("kkFileView 服务启动完成,耗时:{}s,演示页请访问: http://127.0.0.1:8012 ",stopWatch.getTotalTimeSeconds() );
} }
private static void staticInitSystemProperty(){ private static void staticInitSystemProperty(){
//pdfbox兼容低版本jdk //pdfbox兼容低版本jdk
System.setProperty("sun.java2d.cmm", "sun.java2d.cmm.kcms.KcmsServiceProvider"); System.setProperty("sun.java2d.cmm", "sun.java2d.cmm.kcms.KcmsServiceProvider");
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment