本文整理匯總了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);
}