Skip to content

Commit

Permalink
Rename -mavenOptions to -mavenArgs (#445)
Browse files Browse the repository at this point in the history
  • Loading branch information
basil authored Feb 7, 2023
1 parent 7011663 commit 1e6d22d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 16 deletions.
13 changes: 6 additions & 7 deletions src/main/java/org/jenkins/tools/test/CliOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> mavenOptions;
"Arguments to pass to Maven (like -Pxxx; not to be confused with Java arguments or Maven properties).")
private List<String> mavenArgs;

@Parameter(names = "-hookPrefixes", description = "Prefixes of the extra hooks' classes")
private String hookPrefixes;
Expand Down Expand Up @@ -190,9 +189,9 @@ public String getMavenPropertiesFile() {
}

@NonNull
public List<String> getMavenOptions() {
return mavenOptions != null
? Collections.unmodifiableList(mavenOptions)
public List<String> getMavenArgs() {
return mavenArgs != null
? Collections.unmodifiableList(mavenArgs)
: Collections.emptyList();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public void run(Config config, File baseDirectory, File buildLogFile, String...
for (Map.Entry<String, String> 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,
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/jenkins/tools/test/maven/MavenRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Config {

public final Map<String, String> userProperties = new TreeMap<>();

public final List<String> mavenOptions;
public final List<String> mavenArgs;

public Config(PluginCompatTesterConfig pctConfig) {
userSettingsFile = pctConfig.getM2SettingsFile();
Expand All @@ -29,7 +29,7 @@ public Config(PluginCompatTesterConfig pctConfig) {
} catch (IOException e) {
throw new UncheckedIOException(e);
}
mavenOptions = pctConfig.getMavenOptions();
mavenArgs = pctConfig.getMavenArgs();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public class PluginCompatTesterConfig {
private Map<String, String> mavenProperties = Collections.emptyMap();
private String mavenPropertiesFile;

private List<String> mavenOptions = Collections.emptyList();
private List<String> mavenArgs = Collections.emptyList();

// Classpath prefixes of the extra hooks
private List<String> hookPrefixes = new ArrayList<>(List.of("org.jenkins"));
Expand Down Expand Up @@ -172,12 +172,12 @@ public void setMavenPropertiesFiles(String mavenPropertiesFile) {
this.mavenPropertiesFile = mavenPropertiesFile;
}

public List<String> getMavenOptions() {
return mavenOptions;
public List<String> getMavenArgs() {
return mavenArgs;
}

public void setMavenOptions(List<String> mavenOptions) {
this.mavenOptions = mavenOptions;
public void setMavenArgs(List<String> mavenArgs) {
this.mavenArgs = mavenArgs;
}

/**
Expand Down

0 comments on commit 1e6d22d

Please sign in to comment.