标签:url jdb 函数 artifact 获取文件 depend har 配置 tool
场景:单纯打jar包时输入json参数必须是转义过的,很麻烦,直接从文件中读取不需要手动转义
1、加入pom文件
cn.hutool
hutool-all
5.3.5
2、配置setting文件,如(同理,也可以这么配置jdbc信息)
3、main函数下加入
Setting setting = new Setting(new File(fileUrl), CharsetUtil.CHARSET_UTF_8, true);//fileUrl是对应文件的具体地址,如E:/code/f.setting
String uripush=setting.getStr("sendtype");//获取配置文件中的具体参数内容
String json111=setting.getStr("input");
万用工具包hutool-使用java获取文件地址,并读取其中的文件内容
标签:url jdb 函数 artifact 获取文件 depend har 配置 tool