Skip to content

Commit

Permalink
Maven debug in debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
jonesbusy committed Aug 9, 2024
1 parent b31eb8d commit 22a624a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
package io.jenkins.tools.pluginmodernizer.core.config;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.net.URL;
import java.nio.file.Path;
import java.util.List;

public class Config {

@SuppressFBWarnings(value = "MS_SHOULD_BE_FINAL", justification = "Because usage on ConsoleLogFilter")
public static boolean DEBUG = false;

private final String version;
private final List<String> pluginNames;
private final List<String> recipes;
Expand Down Expand Up @@ -96,6 +99,10 @@ public boolean isDryRun() {
return dryRun;
}

public boolean isDebug() {
return DEBUG;
}

public boolean isSkipPullRequest() {
return skipPullRequest;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@ private InvocationRequest createInvocationRequest(Plugin plugin, String... args)
InvocationRequest request = new DefaultInvocationRequest();
request.setPomFile(plugin.getLocalRepository().resolve("pom.xml").toFile());
request.addArgs(List.of(args));
if (config.isDebug()) {
request.addArg("-X");
}
return request;
}

Expand Down

0 comments on commit 22a624a

Please sign in to comment.