Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package jp.plainworks.nokizal.appserv.tool;
- import java.util.TimeZone;
- import org.springframework.boot.SpringApplication;
- import org.springframework.stereotype.Component;
- import org.springframework.context.ApplicationContext;
- import org.springframework.context.annotation.Configuration;
- import org.springframework.context.annotation.ComponentScan;
- import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
- import org.springframework.boot.orm.jpa.EntityScan;
- import org.springframework.boot.CommandLineRunner;
- import org.springframework.boot.ExitCodeGenerator;
- import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
- import org.springframework.beans.factory.annotation.Autowired;
- @Configuration
- @ComponentScan(basePackages = {"xxxxxx"})
- @EnableJpaRepositories(basePackages="xxxxxxx")
- @EntityScan(basePackages="xxxxx")
- @Component
- @EnableAutoConfiguration
- public class CmdMain implements CommandLineRunner, ExitCodeGenerator {
- @Autowired ApplicationContext context;
- // exit code provider
- Integer exitCode = Integer.valueOf(-1);
- public static void main(String[] args) throws Exception {
- SpringApplication app = new SpringApplication(ToolMain.class);
- app.setWebEnvironment(false);
- app.setShowBanner(false);
- app.run(args);
- }
- @Override
- public void run(String ... args) {
- // do some thing
- }
- @Override
- public int getExitCode() {
- return this.exitCode.intValue();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement