Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: SAP/jenkins-library
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 67ba457d840ef6a8598a74676e50823b1bd5881f
Choose a base ref
..
head repository: SAP/jenkins-library
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 099ab8ec07815242a8e8737bc03818f9f84e0597
Choose a head ref
Showing with 15 additions and 15 deletions.
  1. +1 −1 cmd/codeqlExecuteScan.go
  2. +14 −14 cmd/codeqlExecuteScan_test.go
2 changes: 1 addition & 1 deletion cmd/codeqlExecuteScan.go
Original file line number Diff line number Diff line change
@@ -482,7 +482,7 @@ func getMavenSettings(buildCmd string, config *codeqlExecuteScanOptions, utils c
return params
}
for i := 1; i < len(mvnParams); i += 2 {
params = fmt.Sprintf("%s %s=%s", params, mvnParams[i-1], mvnParams[i])
params = fmt.Sprintf("%s \"%s=%s\"", params, mvnParams[i-1], mvnParams[i])
}
}
return params
28 changes: 14 additions & 14 deletions cmd/codeqlExecuteScan_test.go
Original file line number Diff line number Diff line change
@@ -56,7 +56,7 @@ func TestGetMavenSettings(t *testing.T) {
params := getMavenSettings(buildCmd, &config, newCodeqlExecuteScanTestsUtils())
dir, _ := os.Getwd()
projectSettingsPath := filepath.Join(dir, "test.xml")
expectedCommand := fmt.Sprintf(" --settings=%s", projectSettingsPath)
expectedCommand := fmt.Sprintf(" \"--settings=%s\"", projectSettingsPath)
assert.Equal(t, expectedCommand, params)
})

@@ -73,7 +73,7 @@ func TestGetMavenSettings(t *testing.T) {
params := getMavenSettings(buildCmd, &config, newCodeqlExecuteScanTestsUtils())
dir, _ := os.Getwd()
globalSettingsPath := filepath.Join(dir, "global.xml")
expectedCommand := fmt.Sprintf(" --global-settings=%s", globalSettingsPath)
expectedCommand := fmt.Sprintf(" \"--global-settings=%s\"", globalSettingsPath)
assert.Equal(t, expectedCommand, params)
})

@@ -84,7 +84,7 @@ func TestGetMavenSettings(t *testing.T) {
dir, _ := os.Getwd()
globalSettingsPath := filepath.Join(dir, "global.xml")
projectSettingsPath := filepath.Join(dir, "test.xml")
expectedCommand := fmt.Sprintf(" --global-settings=%s --settings=%s", globalSettingsPath, projectSettingsPath)
expectedCommand := fmt.Sprintf(" \"--global-settings=%s\" \"--settings=%s\"", globalSettingsPath, projectSettingsPath)
assert.Equal(t, expectedCommand, params)
})

@@ -94,7 +94,7 @@ func TestGetMavenSettings(t *testing.T) {
params := getMavenSettings(buildCmd, &config, newCodeqlExecuteScanTestsUtils())
dir, _ := os.Getwd()
projectSettingsPath := filepath.Join(dir, ".pipeline/mavenProjectSettings.xml")
expectedCommand := fmt.Sprintf(" --settings=%s", projectSettingsPath)
expectedCommand := fmt.Sprintf(" \"--settings=%s\"", projectSettingsPath)
assert.Equal(t, expectedCommand, params)
})

@@ -104,7 +104,7 @@ func TestGetMavenSettings(t *testing.T) {
params := getMavenSettings(buildCmd, &config, newCodeqlExecuteScanTestsUtils())
dir, _ := os.Getwd()
projectSettingsPath := filepath.Join(dir, ".pipeline/mavenProjectSettings.xml")
expectedCommand := fmt.Sprintf(" --settings=%s", projectSettingsPath)
expectedCommand := fmt.Sprintf(" \"--settings=%s\"", projectSettingsPath)
assert.Equal(t, expectedCommand, params)
})

@@ -114,7 +114,7 @@ func TestGetMavenSettings(t *testing.T) {
params := getMavenSettings(buildCmd, &config, newCodeqlExecuteScanTestsUtils())
dir, _ := os.Getwd()
globalSettingsPath := filepath.Join(dir, ".pipeline/mavenGlobalSettings.xml")
expectedCommand := fmt.Sprintf(" --global-settings=%s", globalSettingsPath)
expectedCommand := fmt.Sprintf(" \"--global-settings=%s\"", globalSettingsPath)
assert.Equal(t, expectedCommand, params)
})

@@ -124,7 +124,7 @@ func TestGetMavenSettings(t *testing.T) {
params := getMavenSettings(buildCmd, &config, newCodeqlExecuteScanTestsUtils())
dir, _ := os.Getwd()
globalSettingsPath := filepath.Join(dir, ".pipeline/mavenGlobalSettings.xml")
expectedCommand := fmt.Sprintf(" --global-settings=%s", globalSettingsPath)
expectedCommand := fmt.Sprintf(" \"--global-settings=%s\"", globalSettingsPath)
assert.Equal(t, expectedCommand, params)
})

@@ -135,7 +135,7 @@ func TestGetMavenSettings(t *testing.T) {
dir, _ := os.Getwd()
globalSettingsPath := filepath.Join(dir, ".pipeline/mavenGlobalSettings.xml")
projectSettingsPath := filepath.Join(dir, ".pipeline/mavenProjectSettings.xml")
expectedCommand := fmt.Sprintf(" --global-settings=%s --settings=%s", globalSettingsPath, projectSettingsPath)
expectedCommand := fmt.Sprintf(" \"--global-settings=%s\" \"--settings=%s\"", globalSettingsPath, projectSettingsPath)
assert.Equal(t, expectedCommand, params)
})

@@ -146,7 +146,7 @@ func TestGetMavenSettings(t *testing.T) {
dir, _ := os.Getwd()
globalSettingsPath := filepath.Join(dir, ".pipeline/mavenGlobalSettings.xml")
projectSettingsPath := filepath.Join(dir, ".pipeline/mavenProjectSettings.xml")
expectedCommand := fmt.Sprintf(" --global-settings=%s --settings=%s", globalSettingsPath, projectSettingsPath)
expectedCommand := fmt.Sprintf(" \"--global-settings=%s\" \"--settings=%s\"", globalSettingsPath, projectSettingsPath)
assert.Equal(t, expectedCommand, params)
})

@@ -157,7 +157,7 @@ func TestGetMavenSettings(t *testing.T) {
dir, _ := os.Getwd()
globalSettingsPath := filepath.Join(dir, ".pipeline/mavenGlobalSettings.xml")
projectSettingsPath := filepath.Join(dir, "test.xml")
expectedCommand := fmt.Sprintf(" --global-settings=%s --settings=%s", globalSettingsPath, projectSettingsPath)
expectedCommand := fmt.Sprintf(" \"--global-settings=%s\" \"--settings=%s\"", globalSettingsPath, projectSettingsPath)
assert.Equal(t, expectedCommand, params)
})

@@ -168,7 +168,7 @@ func TestGetMavenSettings(t *testing.T) {
dir, _ := os.Getwd()
globalSettingsPath := filepath.Join(dir, ".pipeline/mavenGlobalSettings.xml")
projectSettingsPath := filepath.Join(dir, "test.xml")
expectedCommand := fmt.Sprintf(" --global-settings=%s --settings=%s", globalSettingsPath, projectSettingsPath)
expectedCommand := fmt.Sprintf(" \"--global-settings=%s\" \"--settings=%s\"", globalSettingsPath, projectSettingsPath)
assert.Equal(t, expectedCommand, params)
})

@@ -179,7 +179,7 @@ func TestGetMavenSettings(t *testing.T) {
dir, _ := os.Getwd()
globalSettingsPath := filepath.Join(dir, "global.xml")
projectSettingsPath := filepath.Join(dir, ".pipeline/mavenProjectSettings.xml")
expectedCommand := fmt.Sprintf(" --global-settings=%s --settings=%s", globalSettingsPath, projectSettingsPath)
expectedCommand := fmt.Sprintf(" \"--global-settings=%s\" \"--settings=%s\"", globalSettingsPath, projectSettingsPath)
assert.Equal(t, expectedCommand, params)
})

@@ -190,7 +190,7 @@ func TestGetMavenSettings(t *testing.T) {
dir, _ := os.Getwd()
globalSettingsPath := filepath.Join(dir, "global.xml")
projectSettingsPath := filepath.Join(dir, ".pipeline/mavenProjectSettings.xml")
expectedCommand := fmt.Sprintf(" --global-settings=%s --settings=%s", globalSettingsPath, projectSettingsPath)
expectedCommand := fmt.Sprintf(" \"--global-settings=%s\" \"--settings=%s\"", globalSettingsPath, projectSettingsPath)
assert.Equal(t, expectedCommand, params)
})
}
@@ -246,7 +246,7 @@ func TestUpdateCmdFlag(t *testing.T) {
dir, _ := os.Getwd()
globalSettingsPath := filepath.Join(dir, "global.xml")
projectSettingsPath := filepath.Join(dir, "test.xml")
expectedCommand := fmt.Sprintf("mvn clean install --global-settings=%s --settings=%s", globalSettingsPath, projectSettingsPath)
expectedCommand := fmt.Sprintf("mvn clean install \"--global-settings=%s\" \"--settings=%s\"", globalSettingsPath, projectSettingsPath)
assert.Equal(t, expectedCommand, customFlags["--command"])
assert.Equal(t, "", customFlags["-c"])
})