Apache Commons 团队发布 Apache Commons Configuration 2.0-beta2,此版本包含一些 API 改进,主要是提升 API 的稳定性。 完整发行说明: http://www.apache.org/dist/commons/configuration/RELEASE-NOTES.txt 升级指南: http://commons.apache.org/configuration/userguide/upgradeto2_0.html 下载: http://commons.apache.org/proper/commons-configuration/download_configuration.cgi Commons Configuration是一个java应用程序的配置管理类库。可以从properties或者xml文件中加载软件的配置信息,用来构建支撑软件运 行的基础环境。在一些配置文件较多较的复杂的情况下,使用该配置工具比较可以简化配置文件的解析和管理。也提高了开发效率和软件的可维护性。 下面是一个加载 properties 配置文件的代码: CompositeConfiguration config = new CompositeConfiguration(); config.addConfiguration(new PropertiesConfiguration("oschina.properties")); String usernaem = config.getString("username"); String password = config.getString("password"); Commons Configuration 2.0-beta2 发布下载地址