Advertisement
Guest User

Untitled

a guest
Feb 7th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. package jp.plainworks.nokizal.appserv.tool;
  2.  
  3. import java.util.TimeZone;
  4.  
  5. import org.springframework.boot.SpringApplication;
  6. import org.springframework.stereotype.Component;
  7. import org.springframework.context.ApplicationContext;
  8. import org.springframework.context.annotation.Configuration;
  9. import org.springframework.context.annotation.ComponentScan;
  10. import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
  11. import org.springframework.boot.orm.jpa.EntityScan;
  12.  
  13. import org.springframework.boot.CommandLineRunner;
  14. import org.springframework.boot.ExitCodeGenerator;
  15. import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
  16. import org.springframework.beans.factory.annotation.Autowired;
  17.  
  18.  
  19. @Configuration
  20. @ComponentScan(basePackages = {"xxxxxx"})
  21. @EnableJpaRepositories(basePackages="xxxxxxx")
  22. @EntityScan(basePackages="xxxxx")
  23. @Component
  24. @EnableAutoConfiguration
  25. public class CmdMain implements CommandLineRunner, ExitCodeGenerator {
  26.  
  27. @Autowired ApplicationContext context;
  28.  
  29. // exit code provider
  30. Integer exitCode = Integer.valueOf(-1);
  31.  
  32. public static void main(String[] args) throws Exception {
  33. SpringApplication app = new SpringApplication(ToolMain.class);
  34. app.setWebEnvironment(false);
  35. app.setShowBanner(false);
  36. app.run(args);
  37. }
  38.  
  39. @Override
  40. public void run(String ... args) {
  41. // do some thing
  42. }
  43. @Override
  44. public int getExitCode() {
  45. return this.exitCode.intValue();
  46. }
  47.  
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement