/**
* 指定路径下,自动生成 maven pom.xml 文件的 dependency 配置
*/
File libPath = new File("D:\\IdeaProjects\\oaService\\src\\main\\resources\\lib");
// System.out.println(libPath.isDirectory());
String pom = "<dependency>\n" +
"\t<groupId>com.seeyon</groupId>\n" +
"\t<artifactId>%1$s</artifactId>\n" +
"\t<version>1.0.0</version>\n" +
"\t<scope>system</scope>\n" +
"\t<systemPath>${project.basedir}/src/main/resources/lib/%1$s.jar</systemPath>\n" +
"</dependency>\n";
String[] jarFileNameList = libPath.list();
Arrays.stream(jarFileNameList)
.map(s -> s.substring(0, s.length() - 4))
.map(s -> String.format(pom, s))
.forEach(System.out::print);