From 1e6d22df3af7554e7fc35062a735503cad7683c2 Mon Sep 17 00:00:00 2001 From: Basil Crow Date: Tue, 7 Feb 2023 08:03:43 -0800 Subject: [PATCH] Rename `-mavenOptions` to `-mavenArgs` (#445) --- .../java/org/jenkins/tools/test/CliOptions.java | 13 ++++++------- .../jenkins/tools/test/PluginCompatTesterCli.java | 2 +- .../tools/test/maven/ExternalMavenRunner.java | 2 +- .../org/jenkins/tools/test/maven/MavenRunner.java | 4 ++-- .../tools/test/model/PluginCompatTesterConfig.java | 10 +++++----- 5 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/main/java/org/jenkins/tools/test/CliOptions.java b/src/main/java/org/jenkins/tools/test/CliOptions.java index ee887139c..2b2171b52 100644 --- a/src/main/java/org/jenkins/tools/test/CliOptions.java +++ b/src/main/java/org/jenkins/tools/test/CliOptions.java @@ -114,11 +114,10 @@ public class CliOptions { private String mavenPropertiesFile; @Parameter( - names = "-mavenOptions", + names = "-mavenArgs", description = - "Options to pass to Maven (like -Pxxx; not to be confused with Java options," - + " nor Maven properties).") - private List mavenOptions; + "Arguments to pass to Maven (like -Pxxx; not to be confused with Java arguments or Maven properties).") + private List mavenArgs; @Parameter(names = "-hookPrefixes", description = "Prefixes of the extra hooks' classes") private String hookPrefixes; @@ -190,9 +189,9 @@ public String getMavenPropertiesFile() { } @NonNull - public List getMavenOptions() { - return mavenOptions != null - ? Collections.unmodifiableList(mavenOptions) + public List getMavenArgs() { + return mavenArgs != null + ? Collections.unmodifiableList(mavenArgs) : Collections.emptyList(); } diff --git a/src/main/java/org/jenkins/tools/test/PluginCompatTesterCli.java b/src/main/java/org/jenkins/tools/test/PluginCompatTesterCli.java index fb51e0249..194a3f53a 100644 --- a/src/main/java/org/jenkins/tools/test/PluginCompatTesterCli.java +++ b/src/main/java/org/jenkins/tools/test/PluginCompatTesterCli.java @@ -130,7 +130,7 @@ public static void main(String[] args) throws PluginCompatibilityTesterException config.setMavenPropertiesFiles(options.getMavenPropertiesFile()); } - config.setMavenOptions(options.getMavenOptions()); + config.setMavenArgs(options.getMavenArgs()); PluginCompatTester tester = new PluginCompatTester(config); tester.testPlugins(); diff --git a/src/main/java/org/jenkins/tools/test/maven/ExternalMavenRunner.java b/src/main/java/org/jenkins/tools/test/maven/ExternalMavenRunner.java index 4c397fe9f..08ffedc7f 100644 --- a/src/main/java/org/jenkins/tools/test/maven/ExternalMavenRunner.java +++ b/src/main/java/org/jenkins/tools/test/maven/ExternalMavenRunner.java @@ -61,7 +61,7 @@ public void run(Config config, File baseDirectory, File buildLogFile, String... for (Map.Entry entry : config.userProperties.entrySet()) { cmd.add("--define=" + entry); } - cmd.addAll(config.mavenOptions); + cmd.addAll(config.mavenArgs); cmd.addAll(List.of(goals)); LOGGER.log( Level.INFO, diff --git a/src/main/java/org/jenkins/tools/test/maven/MavenRunner.java b/src/main/java/org/jenkins/tools/test/maven/MavenRunner.java index 31cc08ccc..667896548 100644 --- a/src/main/java/org/jenkins/tools/test/maven/MavenRunner.java +++ b/src/main/java/org/jenkins/tools/test/maven/MavenRunner.java @@ -20,7 +20,7 @@ class Config { public final Map userProperties = new TreeMap<>(); - public final List mavenOptions; + public final List mavenArgs; public Config(PluginCompatTesterConfig pctConfig) { userSettingsFile = pctConfig.getM2SettingsFile(); @@ -29,7 +29,7 @@ public Config(PluginCompatTesterConfig pctConfig) { } catch (IOException e) { throw new UncheckedIOException(e); } - mavenOptions = pctConfig.getMavenOptions(); + mavenArgs = pctConfig.getMavenArgs(); } } } diff --git a/src/main/java/org/jenkins/tools/test/model/PluginCompatTesterConfig.java b/src/main/java/org/jenkins/tools/test/model/PluginCompatTesterConfig.java index c3c5aa23e..3704f9a52 100644 --- a/src/main/java/org/jenkins/tools/test/model/PluginCompatTesterConfig.java +++ b/src/main/java/org/jenkins/tools/test/model/PluginCompatTesterConfig.java @@ -80,7 +80,7 @@ public class PluginCompatTesterConfig { private Map mavenProperties = Collections.emptyMap(); private String mavenPropertiesFile; - private List mavenOptions = Collections.emptyList(); + private List mavenArgs = Collections.emptyList(); // Classpath prefixes of the extra hooks private List hookPrefixes = new ArrayList<>(List.of("org.jenkins")); @@ -172,12 +172,12 @@ public void setMavenPropertiesFiles(String mavenPropertiesFile) { this.mavenPropertiesFile = mavenPropertiesFile; } - public List getMavenOptions() { - return mavenOptions; + public List getMavenArgs() { + return mavenArgs; } - public void setMavenOptions(List mavenOptions) { - this.mavenOptions = mavenOptions; + public void setMavenArgs(List mavenArgs) { + this.mavenArgs = mavenArgs; } /**