Jenkins插件开发:用参数化构建参数去替换对应配置文本框内容中${xxx}

直接上代码

    @Test
    public void test3() {
        String original = "1 ${aa}2 ${cc}.";
        HashMap<String, String> envMap = new HashMap<>();
        envMap.put("aa", "true");
        envMap.put("cc", "ccx");
        EnvVars env = new EnvVars(envMap);
        String expand = env.expand(original);
        System.out.println("expand = " + expand);
    }

  

posted @ 2019-11-11 13:50  margo  阅读(430)  评论(0编辑  收藏  举报