Skip to content

Commit 9defbc4

Browse files
committed
replace surefire argline
Move argline property replacement after surefire config extraction
1 parent 66e1597 commit 9defbc4

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

pitest-maven/src/main/java/org/pitest/maven/MojoToReportOptionsConverter.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,16 @@ public ReportOptions convert() {
8888
removeExcludedDependencies(classPath);
8989

9090
ReportOptions option = parseReportOptions(classPath);
91-
return updateFromSurefire(option);
91+
ReportOptions withSureFire = updateFromSurefire(option);
92+
93+
// Null check here is a bad unit testing artifact, should never be null in real life
94+
ReportOptions effective = withSureFire != null ? withSureFire : option;
95+
96+
// argline may contain surefire style properties that require expanding
97+
if (effective.getArgLine() != null) {
98+
effective.setArgLine(this.replacePropertyExpressions(option.getArgLine()));
99+
}
100+
return effective;
92101

93102
}
94103

@@ -196,7 +205,7 @@ private ReportOptions parseReportOptions(final List<String> classPath) {
196205
data.addChildJVMArgs(this.mojo.getJvmArgs());
197206
}
198207
if (this.mojo.getArgLine() != null) {
199-
data.setArgLine(replacePropertyExpressions(this.mojo.getArgLine()));
208+
data.setArgLine(this.mojo.getArgLine());
200209
}
201210

202211
data.setMutators(determineMutators());

0 commit comments

Comments
 (0)