1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-10-30 23:57:50 +02:00

chore: let fortify support maven self Define parameters (#4091)

* let fortify support maven self Define parameters
This commit is contained in:
Frank Cheng
2022-11-07 19:17:11 +08:00
committed by GitHub
parent a2815c4567
commit 7f6fbe4bac
4 changed files with 21 additions and 0 deletions

View File

@@ -137,6 +137,7 @@ func determineArtifact(config fortifyExecuteScanOptions, utils fortifyUtils) (ve
M2Path: config.M2Path,
GlobalSettingsFile: config.GlobalSettingsFile,
ProjectSettingsFile: config.ProjectSettingsFile,
Defines: config.AdditionalMvnParameters,
}
artifact, err := utils.GetArtifact(config.BuildTool, config.BuildDescriptorFile, &versioningOptions)

View File

@@ -23,6 +23,7 @@ import (
type fortifyExecuteScanOptions struct {
AdditionalScanParameters []string `json:"additionalScanParameters,omitempty"`
AdditionalMvnParameters []string `json:"additionalMvnParameters,omitempty"`
Assignees []string `json:"assignees,omitempty"`
AuthToken string `json:"authToken,omitempty"`
BuildDescriptorExcludeList []string `json:"buildDescriptorExcludeList,omitempty"`
@@ -304,6 +305,7 @@ Besides triggering a scan the step verifies the results after they have been upl
func addFortifyExecuteScanFlags(cmd *cobra.Command, stepConfig *fortifyExecuteScanOptions) {
cmd.Flags().StringSliceVar(&stepConfig.AdditionalScanParameters, "additionalScanParameters", []string{}, "List of additional scan parameters to be used for Fortify sourceanalyzer command execution.")
cmd.Flags().StringSliceVar(&stepConfig.AdditionalMvnParameters, "additionalMvnParameters", []string{}, "List of additional maven parameters to be used for Fortify mvn command execution.")
cmd.Flags().StringSliceVar(&stepConfig.Assignees, "assignees", []string{``}, "Defines the assignees for the Github Issue created/updated with the results of the scan as a list of login names.")
cmd.Flags().StringVar(&stepConfig.AuthToken, "authToken", os.Getenv("PIPER_authToken"), "The FortifyToken to use for authentication")
cmd.Flags().StringSliceVar(&stepConfig.BuildDescriptorExcludeList, "buildDescriptorExcludeList", []string{`unit-tests/pom.xml`, `integration-tests/pom.xml`}, "List of build descriptors and therefore modules to exclude from the scan and assessment activities.")
@@ -399,6 +401,15 @@ func fortifyExecuteScanMetadata() config.StepData {
Aliases: []config.Alias{},
Default: []string{},
},
{
Name: "additionalMvnParameters",
ResourceRef: []config.ResourceReference{},
Scope: []string{"PARAMETERS", "STAGES", "STEPS"},
Type: "[]string",
Mandatory: false,
Aliases: []config.Alias{},
Default: []string{},
},
{
Name: "assignees",
ResourceRef: []config.ResourceReference{},

View File

@@ -34,6 +34,7 @@ type Options struct {
DockerImage string
GlobalSettingsFile string
M2Path string
Defines []string
VersionSource string
VersionSection string
VersionField string
@@ -140,6 +141,7 @@ func GetArtifact(buildTool, buildDescriptorFilePath string, opts *Options, utils
ProjectSettingsFile: opts.ProjectSettingsFile,
GlobalSettingsFile: opts.GlobalSettingsFile,
M2Path: opts.M2Path,
Defines: opts.Defines,
},
}
case "mta":

View File

@@ -44,6 +44,13 @@ spec:
- PARAMETERS
- STAGES
- STEPS
- name: additionalMvnParameters
type: "[]string"
description: List of additional maven parameters to be used for Fortify mvn command execution.
scope:
- PARAMETERS
- STAGES
- STEPS
- name: assignees
description: Defines the assignees for the Github Issue created/updated with the results of the scan as a list of login names.
scope: