Created
February 7, 2016 15:16
-
-
Save YooWaan/2acbecb8f668eea105b0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment