本文整理汇总了Java中org.springframework.boot.SpringApplication类的典型用法代码示例。如果您正苦于以下问题:Java SpringApplication类的具体用法?Java SpringApplication怎么用?Java SpringApplication使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SpringApplication类属于org.springframework.boot包,在下文中一共展示了SpringApplication类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import org.springframework.boot.SpringApplication; //导入依赖的package包/类
public static void main(String[] args) {
SpringApplication.run(PostServiceApplication.class, args);
}
示例2: main
import org.springframework.boot.SpringApplication; //导入依赖的package包/类
/**
* Main method, used to run the application.
*/
public static void main(String[] args) throws UnknownHostException {
SpringApplication app = new SpringApplication(Application.class);
SimpleCommandLinePropertySource source = new SimpleCommandLinePropertySource(args);
addDefaultProfile(app, source);
Environment env = app.run(args).getEnvironment();
log.info("Access URLs:\n----------------------------------------------------------\n\t" +
"Local: \t\thttp://127.0.0.1:{}\n\t" +
"External: \thttp://{}:{}\n----------------------------------------------------------",
env.getProperty("server.port"),
InetAddress.getLocalHost().getHostAddress(),
env.getProperty("server.port"));
}
示例3: main
import org.springframework.boot.SpringApplication; //导入依赖的package包/类
public static void main(String[] args) throws InterruptedException {
//SpringApplication.run(TrumpetWebApplication.class, args);
ctx = SpringApplication.run(TrumpetWebApplication.class, args);
// StringRedisTemplate template = ctx.getBean(StringRedisTemplate.class);
// CountDownLatch latch = ctx.getBean(CountDownLatch.class);
// template.convertAndSend("chat", "Hello from Redis!");
// latch.await();
//System.exit(0);
}
示例4: addDefaultProfile
import org.springframework.boot.SpringApplication; //导入依赖的package包/类
/**
* Set a default to use when no profile is configured.
*/
public static void addDefaultProfile(SpringApplication app) {
Map<String, Object> defProperties = new HashMap<>();
/*
* The default profile to use when no other profiles are defined
* This cannot be set in the <code>application.yml</code> file.
* See https://github.com/spring-projects/spring-boot/issues/1219
*/
defProperties.put(SPRING_PROFILE_ACTIVE, getDefaultActiveProfiles());
app.setDefaultProperties(defProperties);
}
示例5: main
import org.springframework.boot.SpringApplication; //导入依赖的package包/类
public static void main(String[] args) {
SpringApplication.run(EstateApplication.class, args);
}
示例6: main
import org.springframework.boot.SpringApplication; //导入依赖的package包/类
public static void main(String[] args) {
/*
* Set classloader you want NoHibernate use to load classes
* (usually it is the classloader of one of your classpath classes)
*/
NoHibernateUtils.setClassLoader(NoHibernateApplication.class.getClassLoader());
/*
* Start Spring Boot application
*/
SpringApplication.run(NoHibernateApplication.class, args);
}
示例7: main
import org.springframework.boot.SpringApplication; //导入依赖的package包/类
public static void main(String[] args) {
SpringApplication.run(SharedWifiMain.class, args);
}
示例8: main
import org.springframework.boot.SpringApplication; //导入依赖的package包/类
public static void main(String[] args) {
SpringApplication.run(SpringBootApplication.class, args);
}
示例9: main
import org.springframework.boot.SpringApplication; //导入依赖的package包/类
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
示例10: main
import org.springframework.boot.SpringApplication; //导入依赖的package包/类
public static void main(String[] args) {
SpringApplication.run(SpringBootElastcsearchExampleApplication.class, args);
}
开发者ID:aillamsun,项目名称:spring-boot-elastcsearch-example,代码行数:4,代码来源:SpringBootElastcsearchExampleApplication.java
示例11: main
import org.springframework.boot.SpringApplication; //导入依赖的package包/类
public static void main(final String[] args) {
SpringApplication.run(BookstoreApplication.class, args);
}
开发者ID:PacktPublishing,项目名称:Docker-and-Kubernetes-for-Java-Developers,代码行数:4,代码来源:BookstoreApplication.java
示例12: main
import org.springframework.boot.SpringApplication; //导入依赖的package包/类
public static void main(String[] args) {
SpringApplication.run(CalendarApplication.class, args);
}
示例13: main
import org.springframework.boot.SpringApplication; //导入依赖的package包/类
public static void main(String[] args) {
SpringApplication.run(FrontendApplication.class, args);
}
示例14: main
import org.springframework.boot.SpringApplication; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
SpringApplication.run(ListenerBootApplication.class, args);
}
示例15: main
import org.springframework.boot.SpringApplication; //导入依赖的package包/类
public static void main(String[] args) {
SpringApplication.run(SpringBootActivemqApplication.class, args);
}