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


Java SpringApplication.setDefaultProperties方法代碼示例

本文整理匯總了Java中org.springframework.boot.SpringApplication.setDefaultProperties方法的典型用法代碼示例。如果您正苦於以下問題:Java SpringApplication.setDefaultProperties方法的具體用法?Java SpringApplication.setDefaultProperties怎麽用?Java SpringApplication.setDefaultProperties使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.springframework.boot.SpringApplication的用法示例。


在下文中一共展示了SpringApplication.setDefaultProperties方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: main

import org.springframework.boot.SpringApplication; //導入方法依賴的package包/類
public static void main(String[] args) {
    SpringApplication app = new SpringApplication(Application.class);
    app.setBannerMode(Banner.Mode.OFF);
    app.setLogStartupInfo(false);
    app.setRegisterShutdownHook(false);
    Map<String, Object> pro = Maps.newHashMap();
    pro.put("logging.level.root", "ERROR");

    app.setDefaultProperties(pro);
    app.run(args);
}
 
開發者ID:mayabot,項目名稱:mynlp,代碼行數:12,代碼來源:Application.java

示例2: addDefaultProfile

import org.springframework.boot.SpringApplication; //導入方法依賴的package包/類
/**
 * Set a default to use when no profile is configured.
 *
 * @param app the Spring application
 */
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_DEFAULT, JHipsterConstants.SPRING_PROFILE_DEVELOPMENT);
    app.setDefaultProperties(defProperties);
}
 
開發者ID:SGKhmCs,項目名稱:speakTogether,代碼行數:16,代碼來源:DefaultProfileUtil.java

示例3: main

import org.springframework.boot.SpringApplication; //導入方法依賴的package包/類
public static void main(String[] args) throws IOException {
        //更改properties配置文件名稱,避免依賴衝突
        Properties properties = new Properties();
        InputStream in = AdminApplication.class.getClassLoader().getResourceAsStream("admin.properties");
        properties.load(in);
        SpringApplication app = new SpringApplication(AdminApplication.class);
        app.setDefaultProperties(properties);
        app.run(args);
//        SpringApplication.run(CommonApplication.class, args);
    }
 
開發者ID:ChinaLHR,項目名稱:JavaQuarkBBS,代碼行數:11,代碼來源:AdminApplication.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) throws IOException {
    //更改properties配置文件名稱,避免依賴衝突
    Properties properties = new Properties();
    InputStream in = PortalApplication.class.getClassLoader().getResourceAsStream("portal.properties");
    properties.load(in);
    SpringApplication app = new SpringApplication(PortalApplication.class);
    app.setDefaultProperties(properties);
    app.run(args);
}
 
開發者ID:ChinaLHR,項目名稱:JavaQuarkBBS,代碼行數:10,代碼來源:PortalApplication.java

示例6: addDefaultProfile

import org.springframework.boot.SpringApplication; //導入方法依賴的package包/類
/**
 * Set a default to use when no profile is configured.
 *
 * @param app the Spring application
 */
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_DEFAULT, Constants.SPRING_PROFILE_DEVELOPMENT);
    app.setDefaultProperties(defProperties);
}
 
開發者ID:quanticc,項目名稱:sentry,代碼行數:16,代碼來源:DefaultProfileUtil.java

示例7: addDefaultProfile

import org.springframework.boot.SpringApplication; //導入方法依賴的package包/類
/**
 * Set a default to use when no profile is configured.
 *
 * @param app the Spring application
 */
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_DEFAULT, JHipsterConstants.SPRING_PROFILE_DEVELOPMENT);
    app.setDefaultProperties(defProperties);
}
 
開發者ID:torgcrm,項目名稱:TorgCRM-Server,代碼行數:16,代碼來源:DefaultProfileUtil.java

示例8: startApplication

import org.springframework.boot.SpringApplication; //導入方法依賴的package包/類
private static void startApplication(String[] args) {
	SpringApplication app = new SpringApplication(Akir.class);
	app.setDefaultProperties(getDefaultProperties());
	app.run(args);
}
 
開發者ID:yushijinhun,項目名稱:akir,代碼行數:6,代碼來源:Akir.java


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