當前位置: 首頁>>代碼示例>>Java>>正文


Java SpringApplication類代碼示例

本文整理匯總了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);
}
 
開發者ID:hantsy,項目名稱:spring-microservice-sample,代碼行數:4,代碼來源:PostServiceApplication.java

示例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"));

}
 
開發者ID:ugouku,項目名稱:shoucang,代碼行數:17,代碼來源:Application.java

示例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);
	}
 
開發者ID:SystemOfAProg,項目名稱:VS2Labor,代碼行數:10,代碼來源:TrumpetWebApplication.java

示例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);
}
 
開發者ID:klask-io,項目名稱:klask-io,代碼行數:14,代碼來源:DefaultProfileUtil.java

示例5: main

import org.springframework.boot.SpringApplication; //導入依賴的package包/類
public static void main(String[] args) {
    SpringApplication.run(EstateApplication.class, args);
}
 
開發者ID:lupindong,項目名稱:xq_seckill_microservice,代碼行數:4,代碼來源:EstateApplication.java

示例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);
}
 
開發者ID:ppedrycz,項目名稱:nohibernate-spring-example,代碼行數:13,代碼來源:NoHibernateApplication.java

示例7: main

import org.springframework.boot.SpringApplication; //導入依賴的package包/類
public static void main(String[] args) {
	SpringApplication.run(SharedWifiMain.class, args);
}
 
開發者ID:rongwei84n,項目名稱:Auts_Assert_manager,代碼行數:4,代碼來源:SharedWifiMain.java

示例8: main

import org.springframework.boot.SpringApplication; //導入依賴的package包/類
public static void main(String[] args) {
    SpringApplication.run(SpringBootApplication.class, args);
}
 
開發者ID:holisticon,項目名稱:holunda,代碼行數:4,代碼來源:SpringBootApplication.java

示例9: main

import org.springframework.boot.SpringApplication; //導入依賴的package包/類
public static void main(String[] args) {
	SpringApplication.run(Application.class, args);
}
 
開發者ID:cmb9400,項目名稱:skip-assistant,代碼行數:4,代碼來源:Application.java

示例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);
}
 
開發者ID:PacktPublishing,項目名稱:Spring-Security-Third-Edition,代碼行數:4,代碼來源:CalendarApplication.java

示例13: main

import org.springframework.boot.SpringApplication; //導入依賴的package包/類
public static void main(String[] args) {
    SpringApplication.run(FrontendApplication.class, args);
}
 
開發者ID:xeraa,項目名稱:microservice-monitoring,代碼行數:4,代碼來源:FrontendApplication.java

示例14: main

import org.springframework.boot.SpringApplication; //導入依賴的package包/類
public static void main(String[] args) throws Exception {
    SpringApplication.run(ListenerBootApplication.class, args);
}
 
開發者ID:PacktPublishing,項目名稱:Spring-5.0-Cookbook,代碼行數:4,代碼來源:ListenerBootApplication.java

示例15: main

import org.springframework.boot.SpringApplication; //導入依賴的package包/類
public static void main(String[] args) {
	SpringApplication.run(SpringBootActivemqApplication.class, args);
}
 
開發者ID:jeikerxiao,項目名稱:SpringBootStudy,代碼行數:4,代碼來源:SpringBootActivemqApplication.java


注:本文中的org.springframework.boot.SpringApplication類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。