Skip to content

Commit 5d8830c

Browse files
committed
Add runId param
1 parent 22392a1 commit 5d8830c

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/main/java/com/assertthat/ReportMojo.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ public class ReportMojo extends AbstractMojo {
6868
private String jql;
6969
@Parameter(property = "ignoreCertErrors", defaultValue = "false")
7070
private Boolean ignoreCertErrors;
71+
@Parameter(property = "runId")
72+
private Long runId = -1L;
7173

7274
public void execute()
7375
throws MojoExecutionException {
@@ -98,13 +100,10 @@ public void execute()
98100
arguments.isIgnoreCertErrors());
99101

100102
String[] files = new FileUtil().findJsonFiles(new File(arguments.getJsonReportFolder()), arguments.getJsonReportIncludePattern(), null);
101-
Long runid = -1L;
102103
for (String f : files) {
103104
try {
104-
runid = apiUtil.upload(runid, arguments.getRunName(), arguments.getJsonReportFolder() + f, arguments.getType(), arguments.getMetadata(), arguments.getJql());
105-
} catch (IOException e) {
106-
throw new MojoExecutionException("Failed to upload report", e);
107-
} catch (JSONException e) {
105+
runId = apiUtil.upload(runId, arguments.getRunName(), arguments.getJsonReportFolder() + f, arguments.getType(), arguments.getMetadata(), arguments.getJql());
106+
} catch (IOException | JSONException e) {
108107
throw new MojoExecutionException("Failed to upload report", e);
109108
}
110109
}

0 commit comments

Comments
 (0)