标签:上传 流水线 问题 tool ima scanner rri void http
具体的流程如下:
安装SonarQube Scanner插件
添加SonarQube凭证
Jenkins进行SonarQube配置
Manage Jenkins->Configure System->SonarQube servers
Manage Jenkins->Global Tool Configuration
SonaQube 关闭审查结果上传到SCM功能
在项目添加SonaQube代码审查(非流水线项目)
添加构建步骤:
正常的项目,没有问题
错误的代码
package com.topcheer; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; /** * */ public class HelloServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { super.doPost(req,resp); } @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { //模拟代码错误 int i = 100/0; //模拟冗余代码 int a = 100; a = 200; resp.getWriter().write("hello Servlet!"); } }
标签:上传 流水线 问题 tool ima scanner rri void http
原文地址:https://www.cnblogs.com/dalianpai/p/12249303.html