当前位置:首页 > Windows程序 > 正文

API访问Maven生成的MANIFEST.MF

2021-05-24 Windows程序

@Controller public class VersionController { @Resource private ServletContext context; @ResponseBody @RequestMapping(value = "/version", method = RequestMethod.GET) @ApiOperation(value = "查看编译版本", response = Map.class, httpMethod = "GET", notes = "查看编译版本") public Map<String, String> version(HttpServletRequest request) throws IOException { Map<String, String> map = new HashMap<String, String>(); MfMap mfMap = Manifests.DEFAULT.append(new ServletMfs(context)); map.put("project-version", mfMap.get("project-version")); map.put("env", mfMap.get("env")); map.put("built-at", mfMap.get("built-at")); return map; } }

温馨提示: 本文由Jm博客推荐,转载请保留链接: https://www.jmwww.net/file/70265.html