Maven结构下 properties 读取
Properties properties = new Properties();
InputStream in = ClassLoader.class.getResourceAsStream("/config/application-time.properties");
if (in == null) {
in = XXX.class.getClassLoader().getResourceAsStream("/config/application-time.properties");
}
if (in == null) {
throw new RuntimeException("读取配置文件config/application-time..properties失败");
}
properties.load(in);
in.close();
properties.getProperty("server.port");