项目自动打包完成打开IE浏览器
parent
a709715328
commit
168785a8cc
@ -0,0 +1,33 @@
|
||||
package com.jingcheng.cms.conf;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
||||
@Component
|
||||
public class MyCommandRunner implements CommandLineRunner {
|
||||
private static Logger logger = LoggerFactory.getLogger(MyCommandRunner.class);
|
||||
|
||||
@Value("${cmd.loginurl}")
|
||||
private String loginUrl;
|
||||
|
||||
@Value("${cmd.command}")
|
||||
private String command;
|
||||
|
||||
|
||||
@Override
|
||||
public void run(String... args) throws Exception {
|
||||
String cmd = command +" "+ loginUrl;
|
||||
Runtime run = Runtime.getRuntime();
|
||||
try{
|
||||
run.exec(cmd);
|
||||
logger.debug("启动浏览器打开项目成功");
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
logger.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue