From 80b77223cdc674e843b3df3f710e3536153a79a9 Mon Sep 17 00:00:00 2001 From: I557621 Date: Mon, 19 Jun 2023 12:08:49 +0200 Subject: [PATCH] improve enabling of Maven access log generation --- pkg/maven/maven.go | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/pkg/maven/maven.go b/pkg/maven/maven.go index 7813aada4..e3ee89e98 100644 --- a/pkg/maven/maven.go +++ b/pkg/maven/maven.go @@ -59,13 +59,18 @@ type utilsBundle struct { *piperhttp.Client } +// NewUtilsBundle provides methods that are used for running a step. +// Setting the stepName parameter to a non-empty string will enable the creation of an access log (URL log). func NewUtilsBundle(stepName string) Utils { + cmd := &command.Command{} + if stepName != "" { + cmd.StepName = stepName + } + utils := utilsBundle{ - Command: &command.Command{ - StepName: stepName, - }, - Files: &piperutils.Files{}, - Client: &piperhttp.Client{}, + Command: cmd, + Files: &piperutils.Files{}, + Client: &piperhttp.Client{}, } utils.Stdout(log.Writer()) utils.Stderr(log.Writer())