Installing and Configuring the FireWire Plug-in in Jenkins

Installing and Configuring the FireWire Plug-in in Jenkins

In this article, we will guide you through the process of installing and configuring the FireWire plug-in in Jenkins, which is compatible with the Ali Development Manual (P3C) and enables static code scanning in Jenkins.

What is the FireWire Plug-in?

The FireWire plug-in is an official Jenkins plug-in that not only checks for security class issues and memory leaks in code but also supports the Ali open source Java Development Statute (P3C project). This article will walk you through the steps to use the FireWire plug-in for static code scanning in Jenkins.

Prerequisites

Before installing the FireWire plug-in, make sure you have a basic understanding of Jenkins. If you are new to Jenkins, we recommend checking out our article on downloading and installing Jenkins for a comprehensive tutorial.

Installing the FireWire Plug-in in Jenkins

To install the FireWire plug-in in Jenkins, follow these steps:

  1. Click on the top left corner of the Jenkins logo and select 系统管理 (System Management).
  2. Click on 管理插件 (Manage Plugins).
  3. Click on the 可选插件 (Optional Plugins) button.
  4. In the filter bar, input fireline and check the FireLine Plugin checkbox.
  5. Click the 直接安装 (Direct Install) button to install the plug-in.
  6. Once the installation is successful, click 返回首页 (Return Home) to start the configuration.

Configuring FireWire in Jenkins

To configure FireWire in Jenkins, follow these steps:

  1. Click on 创建新任务 (Create a New Task) and enter the task name.
  2. Select 构建一个自由风格的软件项目 (Build a Freestyle Software Project) and click OK.
  3. In the General field, enter the name of the project, such as CodeScan.
  4. In the Source Management column, configure the code you want to scan by entering the address of the Git repository. For example, you can use the exclusive test project: GitHub - ariesliu/TestCasesProject: A public project which includes all test cases for fireline..
  5. In the 构建 (Build) column, click 增加构建步骤 (Add Build Step) and select Execute FireLine options.
  6. In the Building column, configure the FireWire-related settings, and the reporting path will have a default address, which does not need to be entered.
  7. Click the Save button to save the configuration.

Viewing Scan Results in Jenkins

After completing the above configuration, you can view the scan results by clicking on the 立即构建 (Build Now) button. Once the task is executed, you can see the path to the FireWire report, as shown in the figure.

Automating Scan Results in Jenkins

To automate the scan results in Jenkins, you can install the HTML Publisher plugin. Follow these steps:

  1. Go to 系统管理 (System Management) and click on 管理插件 (Manage Plugins).
  2. Search for HTML Publisher and click on the direct installation.
  3. Return to your project CodeScan and configure the 构建后操作 (Post-Build Actions) column.
  4. Click 增加构建后操作步骤 (Add Post-Build Action) and select Publish HTML reports.
  5. In the HTML directory to archive field, input the live reports generated column path, which is the default path in the 构建 (Build) column.
  6. In the Index page[s] field, input testReport.html, which is the name of the FireWire-generated HTML report.
  7. Click the Save button to save the configuration.

Running the Configuration Script in Jenkins

To run the configuration script in Jenkins, follow these steps:

  1. Go to 系统管理 (System Management) and click on 脚本命令行 (Script Console).
  2. Enter the following line of code in the text box: System.setProperty(“hudson.model.DirectoryBrowserSupport.CSP”, “”)
  3. Click the 运行 (Run) button to run the script.

Viewing Scan Results in Jenkins

After running the configuration script, you can view the scan results by clicking on the 立即构建 (Build Now) button. Once the task is executed, you can see the HTML report in the HTML Report column.

Understanding Scan Results in Jenkins

The FireWire plug-in provides detailed scan results, including security issues, memory leaks, and code specification class problems. You can view the details of each problem by clicking on the 问题详情列表 (Problem Details List) bar and clicking on the 加号 (Plus) icon next to each row. You can also filter out all problems related to the Ali Development Manual (P3C) by entering p3ckeywords in the Search field.

Conclusion

In this article, we have walked you through the process of installing and configuring the FireWire plug-in in Jenkins, which is compatible with the Ali Development Manual (P3C) and enables static code scanning in Jenkins. We have also demonstrated how to automate the scan results in Jenkins and understand the detailed scan results provided by the FireWire plug-in.