我们目前有一个jenkins管道使用Multibranch Workflow plugin.每个git分支执行一个sonarqube分析,使用该sonar.branch属性创建一个sonarqube项目 .这非常有用,因为在合并之前正在分析每个分支,当分支与master合并并在GIT上消失时问题出现,项目继续在sonarqube上并且需要手动删除.有没有办法自动完成?或任何其他推荐?
我正在使用如下命令在Windows上创建符号链接:
cmd /c mklink /J "${linkName.canonicalPath}" "${targetFolder.canonicalPath}"
Run Code Online (Sandbox Code Playgroud)
从Groovy并使用Runtime.getRuntime().exec()方法
它工作正常,但我想使用java.nio.Files.createSymbolicLink()方法做同样的事情.但我总是得到相同的错误信息:
java.nio.file.FileSystemException: A required privilege is not held by the client.
Run Code Online (Sandbox Code Playgroud)
mklink/J命令适用于当前用户,我想避免提升权限
我想要一个可以在没有参数的情况下使用的简单servlet.就像是 :
http://servername:8080/do/view/username/address
Run Code Online (Sandbox Code Playgroud)
并像参数一样使用它:
http://servername:8080/do?action=view&login=username&page=address
Run Code Online (Sandbox Code Playgroud)
两个网址都具有相同的行为.我更喜欢不使用任何框架,只使用servlet和过滤器.
如何从servlet获取url名称?什么是最好的解决方案?
根据@BalusC的回复,我创建了以下servlet,它可以完成我想要的任务:
@WebServlet("/do/*")
public class ActionTestCasesServlet extends HttpServlet {
protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException
{
String pathInfo = request.getPathInfo();
String[] parts = pathInfo.substring(1).split("/");
RequestDispatcher destination = getServletContext()
.getRequestDispatcher("/" + parts[0] + ".jsp");
if (parts.length > 1) {
request.setAttribute("username", parts[1]);
}
if (parts.length > 2) {
request.setAttribute("page", parts[2]);
}
destination.forward(request, response);
}
}
Run Code Online (Sandbox Code Playgroud)
此代码调用"view.jsp"传递属性"username"和"page".