当前位置: 首页>>代码示例>>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;未经允许,请勿转载。