Skip to content

Commit

Permalink
fix(url-logger): Enable access log generation for mavenBuild (#4421)
Browse files Browse the repository at this point in the history
Co-authored-by: I557621 <[email protected]>
  • Loading branch information
jliempt and I557621 authored Jun 28, 2023
1 parent 9c23cb3 commit bc2cdd1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmd/mavenBuild.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"os"
"path"
"path/filepath"
"reflect"
"strings"

"github.com/SAP/jenkins-library/pkg/buildsettings"
Expand All @@ -25,6 +26,12 @@ const (
func mavenBuild(config mavenBuildOptions, telemetryData *telemetry.CustomData, commonPipelineEnvironment *mavenBuildCommonPipelineEnvironment) {
utils := maven.NewUtilsBundle()

// enables url-log.json creation
cmd := reflect.ValueOf(utils).Elem().FieldByName("Command")
if cmd.IsValid() {
reflect.Indirect(cmd).FieldByName("StepName").SetString("mavenBuild")
}

err := runMavenBuild(&config, telemetryData, utils, commonPipelineEnvironment)
if err != nil {
log.Entry().WithError(err).Fatal("step execution failed")
Expand Down

0 comments on commit bc2cdd1

Please sign in to comment.