com.orion.spring.EnvProperties Maven / Gradle / Ivy
package com.orion.spring;
import com.orion.lang.Console;
import com.orion.lang.collect.MutableHashMap;
import com.orion.lang.collect.MutableHashSet;
import com.orion.utils.Exceptions;
import com.orion.utils.ext.PropertiesExt;
import org.springframework.beans.factory.InitializingBean;
import java.util.Properties;
/**
* maven多环境配置
*
* @author Jiahang Li
* @version 1.0.0
* @since 2020/3/5 23:22
*/
public class EnvProperties {
/*
pom.xml
src/main/java/com/orion/filter/${env}.properties
src/main/resources
true
application.xml
resources根目录
*/
/**
* 配置文件
*/
private static PropertiesExt propertiesExt;
private EnvProperties() {
}
public static String getValue(String key) {
return propertiesExt.getValue(key);
}
public static String getValue(String key, String def) {
return propertiesExt.getValue(key, def);
}
public static MutableHashMap