• 指定路径下,自动生成 maven pom.xml 文件的 dependency 配置,引入外部jar包用


            /**
             * 指定路径下,自动生成 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);
    
    
  • 相关阅读:
    filter
    列表生成式
    迭代
    切片:练习
    Python FAQ
    活在深圳
    “30岁年薪20万算不算很失败?”人民日报这样回答
    ASP.NET Core 运行原理解剖[1]:Hosting
    Kotlin 初窥门径[2]:流程控制
    Kotlin 初窥门径[1]:基础概念
  • 原文地址:https://www.cnblogs.com/pong137/p/15910605.html
Copyright © 2020-2023  润新知