java获取classpath路径下的配置文件
@Test
public void readProperties() throws IOException {
URL url = ClassPathResource.class.getClassLoader().getResource("test.properties");
Properties properties = new Properties();
properties.load(new FileReader(url.getFile()));
System.out.println(properties.get("username")+"|"+properties.get("password"));
}