From dd94c3bd6b44e2c1565ac702d5f30534f3d6ba1a Mon Sep 17 00:00:00 2001 From: Juanma Date: Fri, 22 Nov 2024 19:54:16 +0100 Subject: [PATCH] Hotfix/171 (#379) * Adds Maven debug log option for openrewrite Signed-off-by: Juanma Barea * Changes maven debug argument type Signed-off-by: Juanma Barea --------- Signed-off-by: Juanma Barea --- cmd/openrewrite.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/openrewrite.go b/cmd/openrewrite.go index e52aa04..fcbc540 100644 --- a/cmd/openrewrite.go +++ b/cmd/openrewrite.go @@ -21,6 +21,7 @@ type openRewriteCommand struct { log logr.Logger cleanup bool mavenSettingsFile string + mavenDebugLog bool } func NewOpenRewriteCommand(log logr.Logger) *cobra.Command { @@ -61,6 +62,7 @@ func NewOpenRewriteCommand(log logr.Logger) *cobra.Command { openRewriteCommand.Flags().StringVarP(&openRewriteCmd.goal, "goal", "g", "dryRun", "target goal") openRewriteCommand.Flags().StringVarP(&openRewriteCmd.input, "input", "i", "", "path to application source code directory") openRewriteCommand.Flags().StringVarP(&openRewriteCmd.mavenSettingsFile, "maven-settings", "s", "", "path to a custom maven settings file to use") + openRewriteCommand.Flags().BoolVarP(&openRewriteCmd.mavenDebugLog, "maven debug log level", "x", false, "enable Maven debug logging") return openRewriteCommand } @@ -151,6 +153,10 @@ func (o *openRewriteCommand) Run(ctx context.Context) error { o.log.Info("using custom maven settings file", "path", o.mavenSettingsFile) args = append(args, "-s", o.mavenSettingsFile) } + if o.mavenDebugLog { + o.log.Info("Setting Maven log to debug") + args = append(args, "-X") + } err := container.NewContainer().Run( ctx,