ci tool collaboration jenkins plugin manual - fujitsu...refer to the download site in preface for...

46
FUJITSU Software Agile + Relief CI Tool Collaboration Jenkins Plugin Manual PGR-0003-E6Z0(00) July 2020

Upload: others

Post on 12-Nov-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CI Tool Collaboration Jenkins Plugin Manual - Fujitsu...Refer to the download site in Preface for more information. 1.4 Agile+ Relief The following versions of Agile+ Relief are supported

FUJITSU Software Agile+ Relief

CI Tool Collaboration Jenkins Plugin Manual

PGR-0003-E6Z0(00) July 2020

Page 2: CI Tool Collaboration Jenkins Plugin Manual - Fujitsu...Refer to the download site in Preface for more information. 1.4 Agile+ Relief The following versions of Agile+ Relief are supported

i

Preface CI (Continuous Integration) Tool Collaboration Jenkins Plugin is plugin to total with CI tool (Jenkins) and to display the analytical result of Agile+ Relief. In CI Tool Collaboration Jenkins plugin, the following Functions are offered.

- It is an execution from the Job of Jenkins as for Agile+ Relief (*1) (*2). - It is a View on Jenkins as for the Agile+ Relief execution result (*2).

(*1) One analytical license of Agile+ Relief is consumed about the one-Job execution of Jenkins. (*2) This plugin cannot execute IPA/SEC-C/C++ check, Agile+ Relief C/C++ MISRA option and Agile+

Relief C/C++ CERT option. (*3) This plugin cannot display suppressing message output by pgr5 command of Agile+ Relief C/C++

with — base option and — diff otpion.

In this book, it explains the usage of CI Tool Collaboration Jenkins plugin. Please refer to the following download site for the system requirements of CI Tool Collaboration Jenkins plugin.

Agile+ Relief C/C++ : https://www.fujitsu.com/en/group/fst/products/a-relief/c/download.html Agile+ Relief J : https://www.fujitsu.com/en/group/fst/products/a-relief/j/download.html

Refer to "Message Indications Manual" (Agile+ Relief C/C++) or "Rule Detail Manual" (Agile+ Relief J) for pointed out message of the program defect that Agile+ Relief outputs. Refer to "Command manual" for the error message and the command option that Agile+ Relief outputs.

Page 3: CI Tool Collaboration Jenkins Plugin Manual - Fujitsu...Refer to the download site in Preface for more information. 1.4 Agile+ Relief The following versions of Agile+ Relief are supported

ii

[High Risk Activity]

This Product is designed, developed and manufactured as contemplated for general use, including without limitation, general office use, personal use, household use, and ordinary industrial use, but is not designed, developed and manufactured as contemplated for use accompanying fatal risks or dangers that, unless extremely high safety is secured, could lead directly to death, personal injury, severe physical damage or other loss (hereinafter "High Safety Required Use"), including without limitation, nuclear reaction control in nuclear facility, aircraft flight control, air traffic control, mass transport control, medical life support system, missile launch control in weapon system. You shall not use this Product without securing the sufficient safety required for the High Safety Required Use. If you wish to use this Product for High Safety Required Use, please consult with our sales representatives in charge before such use.

Microsoft, Windows, Windows Server are registered trademarks of Microsoft Corporation in the United States and other countries. MISRA and its logo are registered trademarks of MIRA Ltd, held on behalf of the MISRA Consortium. CERT is registered trademark of Carnegie Mellon University in the United States. The names of other products and services referred to in this document are trademarks of their respective developers and manufacturers.

Particular technologies disclosed in this document may be subject to the Foreign Exchange and Foreign Trade Control Law. Export of this document or any part thereof, or supply of this document or any part thereof to a foreign resident, must be undertaken only in compliance with the provisions of the law.

FUJITSU SOFTWARE TECHNOLOGIES LIMITED

Notes

- Transmission or copying of this document in whole or in part is prohibited.

- The content of this document is subject to change without prior notice.

All rights reserved, Copyright(C) 2016-2020 FUJITSU SOFTWARE TECHNOLOGIES LIMITED.

Page 4: CI Tool Collaboration Jenkins Plugin Manual - Fujitsu...Refer to the download site in Preface for more information. 1.4 Agile+ Relief The following versions of Agile+ Relief are supported

iii

Contents

1. Running Environment ...................................................1

1.1 Running OS .........................................................1 1.2 JDK / JRE ..........................................................1 1.3 CI Tool ............................................................1 1.4 Agile+ Relief .......................................................1

2. Preparation...........................................................2 2.1 Install of Agile+ Relief .............................................2 2.2 Install of CI Tool Collaboration Jenkins plugin .......................2

2.2.1 Configuration of CI Tool Collaboration Jenkins plugin .............2 2.2.2 Install of Agile+ Relief Maven plugin .............................3

2.3 Setting ............................................................7 2.3.1 Configure Jenkins System.........................................7

3. Execution/Confirmation ...............................................13 3.1 When you use Agile+ Relief J ........................................13

3.1.1 Setting of build ...............................................13 3.1.2 Jenkins Job ....................................................15 3.1.3 Build .........................................................21 3.1.4 Confirmation of build result ....................................22

3.2 When you use Agile+ Relief C/C++ ....................................25 3.2.1 Setting of build ...............................................25 3.2.2 Jenkins Job ....................................................27 3.2.3 Build .........................................................34 3.2.4 Confirmation of build result ....................................35

4. Error Message ........................................................38 5. Appendix ............................................................40

5.1 Agile+ Relief J Maven plugin reference...............................40 5.1.1 Property.......................................................40 5.1.2 Output File ....................................................41

5.2 Agile+ Relief C/C++ Maven plugin reference ...........................42 5.2.1 Property.......................................................42 5.2.2 Output File ....................................................42

Page 5: CI Tool Collaboration Jenkins Plugin Manual - Fujitsu...Refer to the download site in Preface for more information. 1.4 Agile+ Relief The following versions of Agile+ Relief are supported

1

1. Running Environment 1.1 Running OS

It runs on Windows and Red Hat Enterprise Linux. Refer to the download site in Preface for more information.

1.2 JDK / JRE

Refer to the download site in Preface for more information. 1.3 CI Tool

It runs on the following CI Tools. - Jenkins

To see the Agile+ Relief results on Jenkins, you need to install the following Jenkins plugin.

- Warnings Next Generation

Moreover, when the Maven project is used with Jenkins, it is necessary to install the following Software in the system.

- Apache Maven

Refer to the download site in Preface for more information. 1.4 Agile+ Relief

The following versions of Agile+ Relief are supported. - Agile+ Relief J floating license version - Agile+ Relief C/C++ floating license version - Agile+ Relief C/C++ Wide-ranging Detective Option

Refer to the download site in Preface for more information.

Page 6: CI Tool Collaboration Jenkins Plugin Manual - Fujitsu...Refer to the download site in Preface for more information. 1.4 Agile+ Relief The following versions of Agile+ Relief are supported

2

2. Preparation 2.1 Install of Agile+ Relief

Agile+ Relief is installed according to installation instructions. JDK is necessary for Agile+ Relief J as the operating environment. Please prepare the environment beforehand. Moreover, please set the install Path of JDK to environment variables JAVA_HOME.

2.2 Install of CI Tool Collaboration Jenkins plugin

Only install it if you use Maven to run Agile+ Relief. 2.2.1 Configuration of CI Tool Collaboration Jenkins plugin

Download and install CI Tool Collaboration Jenkins plugin f rom 'CI Tool Collaboration Jenkins plugin' on the download site described in Preface. Download the self-extracting executable agileplusrelief-jenkins-plugin.exe', copy it to any location, and run it to create an 'agileplusrelief-jenkins-plugin' folder. The Content of the folder 'agileplusrelief-jenkins-plugin' is as follows.

Folder name Description AgilePlusRelief_MavenPlugin Filing folder of Agile+ Relief Maven plugin

The Content of the folder 'AgilePlusRelief_MavenPlugin' is as follows.

File name Description pgreliefj-maven-plugin-1.0.jar Maven plugin of Agile+ Relief J pgreliefc-maven-plugin-1.0.jar Maven plugin of Agile+ Relief C/C++

Page 7: CI Tool Collaboration Jenkins Plugin Manual - Fujitsu...Refer to the download site in Preface for more information. 1.4 Agile+ Relief The following versions of Agile+ Relief are supported

3

2.2.2 Install of Agile+ Relief Maven plugin

Please install Maven before installing Agile+ Relief Maven Plugin.

Agile+ Relief J Maven Plugin

(1) Move to the 'AgilePlusRelief_MavenPlugin' folder by using the command line. (2) Execute the mvn command.

[In the case of Install in the Maven local repository] The following parameters are specified for the mvn command. Parameter Description install:install-file Goal phrase to install plugin in local repository -Dfile=pgreliefj-maven-plugin-1.0.jar File name of Agile+ Relief J Maven plugin

-DgroupId=com.fujitsu.jp.fst.pgrelief .maven

Root package name of Agile+ Relief J Maven plugin

-DartifactId=pgreliefj-maven-plugin Name of Agile+ Relief J Maven plugin -Dversion=1.0 Version of Agile+ Relief J Maven plugin -Dpackaging=jar Format of Agile+ Relief J Maven plugin -DgeneratePom=true Setting whether to generate POM

Example : Commands that installs Agile+ Relief J Maven plugin (version 1.0) in Maven local repository

mvn install:install-file -Df ile=pgreliefj-maven-plugin-1.0.jar -DgroupId=com.fujitsu.jp.fst.pgrelief.maven -DartifactId=pgreliefj-maven-plugin -Dversion=1.0 -Dpackaging=jar -DgeneratePom=true

Page 8: CI Tool Collaboration Jenkins Plugin Manual - Fujitsu...Refer to the download site in Preface for more information. 1.4 Agile+ Relief The following versions of Agile+ Relief are supported

4

[In the case of Install in the Maven remote repository] The following parameters are specified for the mvn command. Parameter Description

deploy:deploy-file Goal phrase to install plugin in remote repository

-Durl="Repository URL" URL of remote repository that installs plugin -DrepositoryId="Repository ID" ID of remote repository that installs plugin -Dfile=pgreliefj-maven-plugin-1.0.jar File name of Agile+ Relief J Maven plugin

-DgroupId=com.fujitsu.jp.fst.pgrelief .maven

Root package name of Agile+ Relief J Maven plugin

-DartifactId=pgreliefj-maven-plugin Name of Agile+ Relief J Maven plugin -Dversion=1.0 Version of Agile+ Relief J Maven plugin -Dpackaging=jar Format of Agile+ Relief J Maven plugin -DgeneratePom=true Setting whether to generate POM

Example : Commands that installs Agile+ Relief J Maven plugin (version 1.0) in Maven remote repository

mvn deploy:deploy-file -Durl=http://xx.xxx.xxx.xxx/repository -DrepositoryId=my-repository -Df ile=pgreliefj-maven-plugin-1.0.jar -DgroupId=com.fujitsu.jp.fst.pgrelief.maven -DartifactId=pgreliefj-maven-plugin -Dversion=1.0 -Dpackaging=jar -DgeneratePom=true

Page 9: CI Tool Collaboration Jenkins Plugin Manual - Fujitsu...Refer to the download site in Preface for more information. 1.4 Agile+ Relief The following versions of Agile+ Relief are supported

5

Agile+ Relief C/C++ Maven Plugin

(1) Move to the 'AgilePlusRelief_MavenPlugin' folder by using the command line. (2) Execute the mvn command.

[In the case of Install in the Maven local repository] The following parameters are specified for the mvn command. Parameter Description install:install-file Goal phrase to install plugin in local repository -Dfile=pgreliefc-maven-plugin-1.0.jar File name of Agile+ Relief C/C++ Maven plugin

-DgroupId=com.fujitsu.jp.fst.pgrelief .maven

Root package name of Agile+ Relief C/C++ Maven plugin

-DartifactId=pgreliefc-maven-plugin Name of Agile+ Relief C/C++ Maven plugin

-Dversion=1.0 Version of Agile+ Relief C/C++ Maven plugin -Dpackaging=jar Format of Agile+ Relief C/C++ Maven plugin -DgeneratePom=true Setting whether to generate POM

Example : Commands that installs Agile+ Relief C/C++ Maven plugin (version 1.0) in Maven local repository

mvn install:install-file -Df ile=pgreliefc-maven-plugin-1.0.jar -DgroupId=com.fujitsu.jp.fst.pgrelief.maven -DartifactId=pgreliefc-maven-plugin -Dversion=1.0 -Dpackaging=jar -DgeneratePom=true

Page 10: CI Tool Collaboration Jenkins Plugin Manual - Fujitsu...Refer to the download site in Preface for more information. 1.4 Agile+ Relief The following versions of Agile+ Relief are supported

6

[In the case of Install in the Maven remote repository] The following parameters are specified for the mvn command. Parameter Description

deploy:deploy-file Goal phrase to install plugin in remote repository

-Durl="Repository URL" URL of remote repository that installs plugin -DrepositoryId="Repository ID" ID of remote repository that installs plugin -Dfile=pgreliefc-maven-plugin-1.0.jar File name of Agile+ Relief C/C++ Maven plugin

-DgroupId=com.fujitsu.jp.fst.pgrelief .maven

Route package name of Agile+ Relief C/C++ Maven plugin

-DartifactId=pgreliefc-maven-plugin Name of Agile+ Relief C/C++ Maven plugin

-Dversion=1.0 Version of Agile+ Relief C/C++ Maven plugin -Dpackaging=jar Format of Agile+ Relief C/C++ Maven plugin -DgeneratePom=true Setting whether to generate POM

Example : Commands that installs Agile+ Relief C/C++ Maven plugin (version 1.0) in Maven remote repository

mvn deploy:deploy-file -Durl=http://xx.xxx.xxx.xxx/repository -DrepositoryId=my-repository -Df ile=pgreliefc-maven-plugin-1.0.jar -DgroupId=com.fujitsu.jp.fst.pgrelief.maven -DartifactId=pgreliefc-maven-plugin -Dversion=1.0 -Dpackaging=jar -DgeneratePom=true

Page 11: CI Tool Collaboration Jenkins Plugin Manual - Fujitsu...Refer to the download site in Preface for more information. 1.4 Agile+ Relief The following versions of Agile+ Relief are supported

7

2.3 Setting

It explains a setting necessary to use Agile+ Relief with Jenkins. 2.3.1 Configure Jenkins System

Sets the Jenkins settings required for Agile+ Relief's License Server System information, running Agile+ Relief, and displaying results. Moreover, when displaying the result of Agile+ Relief, it is necessary to install Warnings Next Generation in the system.

(1) Click "Manage Jenkins" of a left pane of the dashboard.

(2) Click "Configure System".

Page 12: CI Tool Collaboration Jenkins Plugin Manual - Fujitsu...Refer to the download site in Preface for more information. 1.4 Agile+ Relief The following versions of Agile+ Relief are supported

8

(3) Check "Environment variables" of "Global properties".

(4) Click "Add" Button of "List of variables".

Page 13: CI Tool Collaboration Jenkins Plugin Manual - Fujitsu...Refer to the download site in Preface for more information. 1.4 Agile+ Relief The following versions of Agile+ Relief are supported

9

(5) Set "Name" and "Value".

- Setting of License Server

name FST_LICENSE_FILE value port@host Specify the license server of Agile+ Relief. - port : Port number

Specify the Port that the license server of Agile+ Relief uses. Port number can be omitted if you do not specify the port number for the license server. Please confirm the port number that you should set to the administrator of the license server.

- host : License management server IP address or host name Always add '@' at the front even when the port number is omitted.

There is a possibility that Agile+ Relief cannot be executed f rom Jenkins depending on the operating environment when the key is not set.

- Setting to prevent pop-up of license verification from appearing

name FLEXLM_BATCH value 1 The license verification pop-up of Agile+ Relief is prevented from appearing. The pop up of the license attestation is displayed when the key is not set, and there is a possibility that the execution of the job of Jenkins does not progress.

Page 14: CI Tool Collaboration Jenkins Plugin Manual - Fujitsu...Refer to the download site in Preface for more information. 1.4 Agile+ Relief The following versions of Agile+ Relief are supported

10

- Setting of environment variables of Agile+ Relief [When you use Agile+ Relief J]

name PGRJ_HOME value Agile+ Relief InstallFolder¥PGReliefJava

[When you use Agile+ Relief C/C++]

name EPOMDIR value Windows :

Agile+ Relief InstallFolder¥PGRelief¥Analyze¥EPOM Linux :

Agile+ Relief InstallDirectory/FFSTaplus/FFSTpgr/Analyze/EPOM name PATH (Only Linux) value Agile+ Relief InstallDirectory/FFSTaplus/FFSTpgr/Analyze/EPOM name LD_LIBRARY_PATH (Only Linux) value Agile+ Relief InstallDirectory/FFSTaplus/FFSTpgr/Analyze/EPOM/lib There is a possibility that Agile+ Relief cannot be executed f rom Jenkins depending on the operating environment when the key is not set.

(6) Set "Parsers" of Groovy Based Warnings Parsers.

Page 15: CI Tool Collaboration Jenkins Plugin Manual - Fujitsu...Refer to the download site in Preface for more information. 1.4 Agile+ Relief The following versions of Agile+ Relief are supported

11

- Setting of environment variables of Agile+ Relief [When you use Agile+ Relief J]

Name AgilePlus Relief J ID agileplusrelief_j Regular expression

(.*),(¥d+),([^,]*),([^,]*),(.*)

Mapping script

import edu.hm.hafner.analysis.Severity builder.setFileName(matcher.group(1)) .setLineStart(Integer.parseInt(matcher.group(2))) .setCategory(matcher.group(3)) .setType(matcher.group(4)) .setMessage(matcher.group(5)) if (matcher.group(3).startsWith("S") || matcher.group(3).startsWith("!") ){ builder.setSeverity(Severity.WARNING_HIGH) }else if (matcher.group(3).startsWith("W")){ builder.setSeverity(Severity.WARNING_NORMAL) }else{ builder.setSeverity(Severity.WARNING_LOW) } return builder.buildOptional();

Log message

SJIS source file name,line number,group,messageID,message C:¥sampleDir¥sample.java,1,W:Reliability,pgj00000,Sample Message

Page 16: CI Tool Collaboration Jenkins Plugin Manual - Fujitsu...Refer to the download site in Preface for more information. 1.4 Agile+ Relief The following versions of Agile+ Relief are supported

12

[When you use Agile+ Relief C/C++] Name AgilePlus Relief C ID agileplusrelief_c Regular expression

¥"(.*)¥",(¥d+),¥"(.)¥",¥"([^,]*)¥",¥"(.*)¥"

Mapping script

import edu.hm.hafner.analysis.Severity builder.setFileName(matcher.group(1)) .setLineStart(Integer.parseInt(matcher.group(2))) .setCategory(matcher.group(3)) .setType(matcher.group(4)) .setMessage(matcher.group(5)) if (matcher.group(3).equals("a") || matcher.group(3).equals("!") ){ builder.setSeverity(Severity.WARNING_HIGH) }else if (matcher.group(3).equals("b") || matcher.group(3).equals("h")){ builder.setSeverity(Severity.WARNING_NORMAL) }else{ builder.setSeverity(Severity.WARNING_LOW) } return builder.buildOptional();

Log message

SJIS "source file name",line number,"group","messageID","message" "C:¥sampleDir¥sample.c",1,"a","pgr0000","Sample Message"

Page 17: CI Tool Collaboration Jenkins Plugin Manual - Fujitsu...Refer to the download site in Preface for more information. 1.4 Agile+ Relief The following versions of Agile+ Relief are supported

13

3. Execution/Confirmation 3.1 When you use Agile+ Relief J 3.1.1 Setting of build

Describe the setting necessary for the execution of Agile+ Relief J in Maven or the Windows batch command according to the build environment. The setting example is as follows.

Maven

Describe the setting of Agile+ Relief J in POM File (pom.xml). The following example assumes that the Jenkins workspace is set to "C:¥Jenkins¥Workspace". Details of the Agile+ Relief J Maven Properties are described to 5.1.1 Property.

: <build> <plugins> :

<!-- Agile+ Relief J Maven Plugin --> <plugin> <groupId>com.fujitsu.jp.fst.pgrelief.maven</groupId> <artifactId>pgreliefj-maven-plugin</artifactId> <version>1.0</version> <!-- Add the Property when you use option. --> <configuration> <pgrCheckRuleDefinitionFile>C:/Program Files/AgilePlus/PGReliefJava/rule.pgrj</pgrCheckRuleDefinitionFile> <pgrOutputDirectory>C:/Jenkins/Workspace/Report</pgrOutputDirectory> </configuration> <executions> <execution> <!-- Phase of Agile+ Relief J --> <phase>verify</phase> <goals> <!-- Goal of Agile+ Relief J (Requirement) --> <goal>pgreliefj</goal> </goals> </execution> </executions> </plugin> </plugins> </build> :

Page 18: CI Tool Collaboration Jenkins Plugin Manual - Fujitsu...Refer to the download site in Preface for more information. 1.4 Agile+ Relief The following versions of Agile+ Relief are supported

14

Windows batch command Describe the setting of Agile+ Relief J in Windows batch file. The following example assumes that the Jenkins workspace is set to "C:¥Jenkins¥Workspace". Describe the pgrjava command. Details of the pgrjava command are described to "Command Manual" of Agile+ Relief J.

"C:¥Program Files¥AgilePlus¥PGReliefJava¥pgrjava.bat" "C:¥Jenkins¥Workspace¥ProjectJ¥src" "C:¥Jenkins¥Workspace¥ProjectJ¥bin" "C:¥Jenkins¥Workspace¥Report¥pgreliefj_message.csv"

Page 19: CI Tool Collaboration Jenkins Plugin Manual - Fujitsu...Refer to the download site in Preface for more information. 1.4 Agile+ Relief The following versions of Agile+ Relief are supported

15

3.1.2 Jenkins Job

Freestyle project

(1) Click "Add build step" of the Build section.

(2) Click the added build step.

* Select the build Step set by 3.1.1 Setting of build. * "Execute shell" cannot be used for Agile+ Relief J.

Page 20: CI Tool Collaboration Jenkins Plugin Manual - Fujitsu...Refer to the download site in Preface for more information. 1.4 Agile+ Relief The following versions of Agile+ Relief are supported

16

1. Invoke top-level Maven targets Specify "Goals".

* Specify either the following for "Goals".

- Phase set to POM file (pom.xml) of 3.1.1 Setting of build - Goal that Agile+ Relief Maven plugin offers (pgreliefj)

2. Execute Windows batch command

Specify "Command".

* Specify the Windows batch file made by 3.1.1 Setting of build by using the call

command.

Page 21: CI Tool Collaboration Jenkins Plugin Manual - Fujitsu...Refer to the download site in Preface for more information. 1.4 Agile+ Relief The following versions of Agile+ Relief are supported

17

(3) Click "Add post-build action" of the Post-build Actions section.

(4) Click "Record compiler warning and static analysis result".

Page 22: CI Tool Collaboration Jenkins Plugin Manual - Fujitsu...Refer to the download site in Preface for more information. 1.4 Agile+ Relief The following versions of Agile+ Relief are supported

18

(5) Specify "Static Analysis Tools" of the Record compiler warning and static analysis result section.

Name Value Description Tool Groovy Parser Specif ies the tool used by the "Record

compiler warning and static analysis result" feature. (fixed value)

Parser AgilePlus Relief J Specif ies the parser used by the "Record compiler warning and static analysis result" feature. (f ixed value) It is necessary to set parser (Groovy Based Warnings Parsers) to Jenkins beforehand. Please refer to 2.3.1 Configure Jenkins System for details.

Report File Pattern

Report/pgreliefj_message.csv Specify the result file of Agile+ Relief J. This value is different according to the build setting. "Report/pgreliefj_message.csv" is specified for the example described in 3.1.1 Setting of build.

Report Encoding

Shif t_JIS Specifies the character code of the Agile+ Relief J result file. (fixed value)

Page 23: CI Tool Collaboration Jenkins Plugin Manual - Fujitsu...Refer to the download site in Preface for more information. 1.4 Agile+ Relief The following versions of Agile+ Relief are supported

19

Maven project

(1) Specify "Goals and options" of the Build section.

* Specify phase set to POM File (pom.xml) of 3.1.1 Setting of build or goal that Agile+ Relief

J Maven plugin offers. (2) Click "Add post-build action" of the Post-build Actions section.

Page 24: CI Tool Collaboration Jenkins Plugin Manual - Fujitsu...Refer to the download site in Preface for more information. 1.4 Agile+ Relief The following versions of Agile+ Relief are supported

20

(3) Click "Record compiler warning and static analysis result".

(4) Specify "Static Analysis Tools" of the Record compiler warning and static analysis

result section.

* This setting is the same as in "Freestyle project".

Page 25: CI Tool Collaboration Jenkins Plugin Manual - Fujitsu...Refer to the download site in Preface for more information. 1.4 Agile+ Relief The following versions of Agile+ Relief are supported

21

3.1.3 Build

Execute the build Job of Jenkins. Do either of the following Operations on the dashboard of Jenkins.

- Click the Build execution icon.

- Click "Build Now" of a left pane after clicking the Job of the target.

Page 26: CI Tool Collaboration Jenkins Plugin Manual - Fujitsu...Refer to the download site in Preface for more information. 1.4 Agile+ Relief The following versions of Agile+ Relief are supported

22

3.1.4 Confirmation of build result

The build result is displayed on the dashboard of Jenkins. Confirm the build of the Job displayed in "All" view has succeeded, and confirm the execution result of Agile+ Relief.

(1) Display the dashboard of Jenkins.

(2) Click the target Job displayed in "All" view.

Page 27: CI Tool Collaboration Jenkins Plugin Manual - Fujitsu...Refer to the download site in Preface for more information. 1.4 Agile+ Relief The following versions of Agile+ Relief are supported

23

(3) The latest build displayed in "Build History" of a left pane is clicked.

(4) Conf irm the error message is not output on the dashboard of Jenkins.

Page 28: CI Tool Collaboration Jenkins Plugin Manual - Fujitsu...Refer to the download site in Preface for more information. 1.4 Agile+ Relief The following versions of Agile+ Relief are supported

24

(5) Click "AgilePlus Relief J Warnings" of a left pane.

(6) Conf irm the analytical result of Agile+ Relief is displayed.

Page 29: CI Tool Collaboration Jenkins Plugin Manual - Fujitsu...Refer to the download site in Preface for more information. 1.4 Agile+ Relief The following versions of Agile+ Relief are supported

25

3.2 When you use Agile+ Relief C/C++ 3.2.1 Setting of build

Describe the setting necessary for the execution of Agile+ Relief C/C++ in Maven, Windows batch command or the Shell command according to the build environment. The setting example is as follows.

Maven

Describe the setting of Agile+ Relief C/C++ in POM File (pom.xml). The following example assumes that the Jenkins workspace is set to "C:¥Jenkins¥Workspace". Details of the Agile+ Relief C/C++ Maven Properties are described to 5.2.1 Property.

: <build> <plugins> :

<!-- Agile+ Relief C/C++ Maven Plugin --> <plugin> <groupId>com.fujitsu.jp.fst.pgrelief.maven</groupId> <artifactId>pgreliefc-maven-plugin</artifactId> <version>1.0</version> <!-- Add the Property when you use option. --> <configuration> <pgrOutputDirectory>C:/Jenkins/Workspace/Report</pgrOutputDirectory> <pgrOptions> <pgrOption>-Z"C:/Program Files/AgilePlus/PGRelief/Analyze/EPOM/MessageInfo/default-pgr.rul"</pgrOption> <!-- Other additional examples <pgrOption>-KMS/VC2010</pgrOption> <pgrOption>-Y"C:/Jenkins/Workspace/ProjectC/stdinc"</pgrOption> <pgrOption>-I"C:/Jenkins/Workspace/ProjectC/priinc"</pgrOption> <pgrOption>-D_DEBUG</pgrOption> <pgrOption>-SSJIS</pgrOption> --> </pgrOptions> </configuration> <executions> <execution> <!-- Phase of Agile+ Relief C/C++ --> <phase>verify</phase> <goals> <!-- Goal of Agile+ Relief C/C++ (Requirement) --> <goal>pgreliefc</goal> </goals> </execution> </executions> </plugin> </plugins> </build> :

Page 30: CI Tool Collaboration Jenkins Plugin Manual - Fujitsu...Refer to the download site in Preface for more information. 1.4 Agile+ Relief The following versions of Agile+ Relief are supported

26

Windows batch command Describe the setting of Agile+ Relief C/C++ in Windows batch file. The following example assumes that the Jenkins workspace is set to "C:¥Jenkins¥Workspace". Describe the pgr5 command. It is necessary to specify "--qm". Details of the pgr5 command are described to "Command Manual" of Agile+ Relief C/C++.

shell

Describe the setting of Agile+ Relief C/C++ in the shell script. The following example assumes that the Jenkins workspace is set to "C:¥Jenkins¥Workspace". Describe the pgr5 command. It is necessary to specify "--qm". Details of the pgr5 command are described to "Command Manual" of Agile+ Relief C/C++.

"C:¥Program Files¥AgilePlus¥PGRelief¥Analyze¥EPOM¥pgr5.exe" --qm "C:¥Jenkins¥Workspace¥ProjectC¥src¥sample1.c" > "C:¥Jenkins¥Workspace¥Report¥pgreliefc_message.csv"

"/opt/FFSTaplus/FFSTpgr/Analyze/EPOM/pgr5" --qm "/home/Jenkins/Workspace/ProjectC/src/sample1.c" > "/home/Jenkins/Workspace/Report/pgreliefc_message.csv"

Page 31: CI Tool Collaboration Jenkins Plugin Manual - Fujitsu...Refer to the download site in Preface for more information. 1.4 Agile+ Relief The following versions of Agile+ Relief are supported

27

3.2.2 Jenkins Job

Freestyle project

(1) Click "Add build step" of the Build section.

(2) Click the added build step.

* Select the build Step set by 3.2.1 Setting of build.

Page 32: CI Tool Collaboration Jenkins Plugin Manual - Fujitsu...Refer to the download site in Preface for more information. 1.4 Agile+ Relief The following versions of Agile+ Relief are supported

28

1. Invoke top-level Maven targets Specify "Goals".

* Specify either the following for "Goals".

- Phase set to POM file (pom.xml) of 3.2.1 Setting of build - Goal that Agile+ Relief Maven plugin offers (pgreliefc)

2. Execute Windows batch command Specify "Command".

* Specify the Windows batch file made by 3.2.1 Setting of build by using the call

command.

Page 33: CI Tool Collaboration Jenkins Plugin Manual - Fujitsu...Refer to the download site in Preface for more information. 1.4 Agile+ Relief The following versions of Agile+ Relief are supported

29

3. Execute shell Specify "Command".

* Specify the shell script made by 3.2.1 Setting of build by using the sh command.

(3) Click "Add post-build action" of the Post-build Actions section.

Page 34: CI Tool Collaboration Jenkins Plugin Manual - Fujitsu...Refer to the download site in Preface for more information. 1.4 Agile+ Relief The following versions of Agile+ Relief are supported

30

(4) Click "Record compiler warning and static analysis result".

(5) Specify "Static Analysis Tools" of the Record compiler warning and static analysis

result section.

Name Value Description Tool Groovy Parser Specif ies the tool used by the "Record

compiler warning and static analysis result" feature. (fixed value)

Parser AgilePlus Relief C Specif ies the parser used by the "Record compiler warning and static analysis result" feature. (f ixed value) It is necessary to set parser (Groovy Based Warnings Parsers) to Jenkins beforehand. Please refer to 2.3.1 Conf igure Jenkins System for details.

Page 35: CI Tool Collaboration Jenkins Plugin Manual - Fujitsu...Refer to the download site in Preface for more information. 1.4 Agile+ Relief The following versions of Agile+ Relief are supported

31

Report File Pattern

Report/pgreliefc_message.csv Specify the result file of Agile+ Relief C/C++. This value is different according to the build setting. "Report/pgreliefc_message.csv" is specified for the example described in 3.2.1 Setting of build.

Report Encoding

(Unspecified) Specifies the character code of the Agile+ Relief C/C++ result file. This value is different according to the build setting. It is unspecified for the example described in 3.2.1 Setting of build.

Maven project

(1) Specify "Goals and options" of the Build section.

* Specify phase set to POM File (pom.xml) of 3.2.1 Setting od build or goal that Agile+

Relief C/C++ Maven plugin offers.

Page 36: CI Tool Collaboration Jenkins Plugin Manual - Fujitsu...Refer to the download site in Preface for more information. 1.4 Agile+ Relief The following versions of Agile+ Relief are supported

32

(2) Click "Add post-build action" of the Post-build Actions section.

(3) Click "Record compiler warning and static analysis result".

Page 37: CI Tool Collaboration Jenkins Plugin Manual - Fujitsu...Refer to the download site in Preface for more information. 1.4 Agile+ Relief The following versions of Agile+ Relief are supported

33

(4) Specify "Static Analysis Tools" of the Record compiler warning and static analysis result section.

* This setting is the same as in "Freestyle project".

Page 38: CI Tool Collaboration Jenkins Plugin Manual - Fujitsu...Refer to the download site in Preface for more information. 1.4 Agile+ Relief The following versions of Agile+ Relief are supported

34

3.2.3 Build

Execute the build Job of Jenkins. Do either of the following Operations on the dashboard of Jenkins.

- Click the Build execution icon.

- Click "Build Now" of a left pane after clicking the Job of the target.

Page 39: CI Tool Collaboration Jenkins Plugin Manual - Fujitsu...Refer to the download site in Preface for more information. 1.4 Agile+ Relief The following versions of Agile+ Relief are supported

35

3.2.4 Confirmation of build result

The build result is displayed on the dashboard of Jenkins. Confirm the build of the Job displayed in "All" view has succeeded, and confirm the execution result of Agile+ Relief.

(1) Display the dashboard of Jenkins.

(2) Click the target Job displayed in "All" view.

Page 40: CI Tool Collaboration Jenkins Plugin Manual - Fujitsu...Refer to the download site in Preface for more information. 1.4 Agile+ Relief The following versions of Agile+ Relief are supported

36

(3) The latest build displayed in "Build History" of a left pane is clicked.

(4) Conf irm the error message is not output on the dashboard of Jenkins.

Page 41: CI Tool Collaboration Jenkins Plugin Manual - Fujitsu...Refer to the download site in Preface for more information. 1.4 Agile+ Relief The following versions of Agile+ Relief are supported

37

(5) Click "AgilePlus Relief C Warnings" of a left pane.

(6) Conf irm the analytical result of Agile+ Relief is displayed.

Page 42: CI Tool Collaboration Jenkins Plugin Manual - Fujitsu...Refer to the download site in Preface for more information. 1.4 Agile+ Relief The following versions of Agile+ Relief are supported

38

4. Error Message

Error message related to Maven plugin

Error message format [@1] @2 @3:@4 Explanation of Error message format @1 The error level is displayed. Refer to the following message list for details. @2 The message that Maven outputs is displayed. (This output might be omitted.) @3 Either of "Agile+ Relief J Maven Plugin Error" or "Agile+ Relief C Maven Plugin

Error" is displayed. @4 The error message is displayed. Refer to the following message list for details. Message list Error level

ErrorMessage Description Measure

ERROR Failed to execute Agile+ Relief J. or Failed to execute Agile+ Relief C/C++.

It is an errors of the Agile+ Relief command execution.

Conf irm the Content of the Agile+ Relief output file. [Agile+ Relief J output file]

pgreliefj_message.csv or pgreliefj_result.txt

[Agile+ Relief C/C++ output f ile]

pgreliefc_message.csv or pgreliefc_result.txt

Details of the error message that Agile+ Relief outputs are written in "Command Manual".

ERROR Plugin execute error. It failed in the execution of the Agile+ Relief Maven plugin.

Conf irm the Content of the Agile+ Relief output file. [Agile+ Relief J output file]

pgreliefj_message.csv or pgreliefj_result.txt

[Agile+ Relief C/C++ output f ile]

pgreliefc_message.csv or pgreliefc_result.txt

ERROR Install directory setting error.

The installation folder of Agile+ Relief is not set.

[Agile+ Relief J] Set environment variable

PGRJ_HOME. [Agile+ Relief C/C++]

Set environment variable EPOMDIR.

ERROR Install directory @1 is not exist. @1:Folder

There is a problem in the setting of install the Folder of Agile+ Relief.

[Agile+ Relief J] Set environment variable

PGRJ_HOME correctly. [Agile+ Relief C/C++] Set environment variable EPOMDIR correctly.

ERROR Unsafe command An illegal Character is Do not contain these

Page 43: CI Tool Collaboration Jenkins Plugin Manual - Fujitsu...Refer to the download site in Preface for more information. 1.4 Agile+ Relief The following versions of Agile+ Relief are supported

39

line string. included in the command line text. ;|&`()$<>*?{}[]!

Characters in the command line text.

WARNING

Skip non existing source Directory. @1 No sources to analyze. @1:Folder

The File of the analysis object does not exist. For instance, when the source file of the analysis object does not exist, this error message might be displayed in the multimodule project.

Conf irm whether there is a specified mistake of the source folder and the source file.

Page 44: CI Tool Collaboration Jenkins Plugin Manual - Fujitsu...Refer to the download site in Preface for more information. 1.4 Agile+ Relief The following versions of Agile+ Relief are supported

40

5. Appendix 5.1 Agile+ Relief J Maven plugin reference

The execution result of Agile+ Relief J (pgrjava command) can be output by using the Agile+ Relief J Maven plugin. Information groupId com.fujitsu.jp.fst.pgrelief.maven artifactId pgreliefj-maven-plugin version 1.0 phase (default) verify goal pgreliefj

5.1.1 Property

The property can be set to POM File (pom.xml) by the <configuration> tag. Set it if necessary. The property where the default value exists need not be set as long as there is no special reason. Name Type Description Default value pgrCheckRuleDefinitionFile

File Specify the inspection point Def inition File by the full path. (Correspond to the "-r" of the pgrjava command.)

Check Rule Definition File in the Folder set by environment variables PGRJ_HOME (rule.pgrj)

pgrSrcDirectory

File Specify the Folder where the source files that to be the source folder and to be checked is stored by the full path.

First the Folder of compile source folder list of Maven project (${project.compileSourceRoots})

pgrClassesDirectory

File Specify the Folder where the class files that to be Class the Folder and to be checked is stored by the full path.

Classes the Folder in Target the Folder of Maven project (${project.build.directory}/classes)

pgrClassPathListFile

File Specify the File that describes the Class Path list File and the Class Path list by the full path. (Correspond to the "-af" of the pgrjava command.)

Class Path list of Maven project

pgrOutputDirectory

File Specify presentation the Folder of the Agile+ Relief J execution result file. * "pgrelief j_message.csv" is output to specified the Folder.

The Folder of build target of Maven project (${project.build.directory})

pgrEncoding

Text Specify the code of the Java source to be checked. The setting of the following values can be done. Cp1252 | UTF-8

(Correspond to the "-e" of the pgrjava command.)

Encoding setting of Maven project (${project.build.sourceEncoding}) * Encode to which Agile+ Relief J cannot be recognized might be set. In that case, specify this option.

Page 45: CI Tool Collaboration Jenkins Plugin Manual - Fujitsu...Refer to the download site in Preface for more information. 1.4 Agile+ Relief The following versions of Agile+ Relief are supported

41

pgrOptions List Specify the option of the pgrjava command.

There is no specification

5.1.2 Output File

When the execution of Agile+ Relief ends, the following files are output. Name Content Output Folder pgreliefj_message.csv Agile+ Relief J analytical

result The Folder specified by pgrOutputDirectory property of POM File

pgreliefj_result.txt Standard Output of pgrjava command

The Folder specified by pgrOutputDirectory property of POM File

Page 46: CI Tool Collaboration Jenkins Plugin Manual - Fujitsu...Refer to the download site in Preface for more information. 1.4 Agile+ Relief The following versions of Agile+ Relief are supported

42

5.2 Agile+ Relief C/C++ Maven plugin reference

The execution result of Agile+ Relief C/C++ (pgr5 command) can be output by using the Agile+ Relief C/C++ Maven plugin. Information groupId com.fujitsu.jp.fst.pgrelief.maven artifactId pgreliefc-maven-plugin version 1.0 phase (default) verify goal pgreliefc

5.2.1 Property

The property can be set to POM File (pom.xml) by the <configuration> tag. Set it if necessary. The property where the default value exists need not be set as long as there is no special reason. Name Type Description Default value pgrSrcDirectory

File Specify the Folder where the source files that to be the source folder and to be checked is stored by the full path.

The Folder of src of Maven project (${project.basedir}/src)

pgrCplusplusExt

List Specify the extension of the C++ source file.

.cc and .cpp

pgrOutputDirectory

File Specify presentation the Folder of the Agile+ Relief C/C++ execution result file. * "pgreliefc_message.csv" is output to specified the Folder.

The Folder of build target of Maven project (${project.build.directory})

pgrOptions List Specify the option of the pgr5 command.

There is no specification

5.2.2 Output File

When the execution of Agile+ Relief ends, the following files are output. Name Content Output Folder pgreliefc_message.csv Agile+ Relief C/C++

analytical result The Folder specified by pgrOutputDirectory property of POM File

pgreliefc_result.txt Standard Output of pgr5 command

The Folder specified by pgrOutputDirectory property of POM File