public void execute()

in src/main/java/org/apache/maven/plugins/invoker/VerifyMojo.java [99:138]


    public void execute() throws MojoExecutionException, MojoFailureException {
        if (skipInvocation) {
            getLog().info("Skipping invocation per configuration."
                    + " If this is incorrect, ensure the skipInvocation parameter is not set to true.");
            return;
        }

        File[] reportFiles = ReportUtils.getReportFiles(reportsDirectory);
        if (reportFiles.length <= 0) {
            if (Boolean.TRUE.equals(failIfNoProjects)) {
                throw new MojoFailureException("No projects to invoke!");
            }
            getLog().info("No invoker report files found, nothing to check.");
            return;
        }

        BuildJobXpp3Reader reader = new BuildJobXpp3Reader();

        InvokerSession invokerSession = new InvokerSession();

        for (File reportFile : reportFiles) {
            try (Reader xmlReader = new XmlStreamReader(reportFile)) {
                invokerSession.addJob(reader.read(xmlReader));
            } catch (XmlPullParserException e) {
                throw new MojoExecutionException("Failed to parse report file: " + reportFile, e);
            } catch (IOException e) {
                throw new MojoExecutionException("Failed to read report file: " + reportFile, e);
            }
        }

        if (streamLogsOnFailures) {
            invokerSession.logFailedBuildLog(getLog(), ignoreFailures);
        }

        if (!suppressSummaries) {
            invokerSession.logSummary(getLog(), ignoreFailures);
        }

        invokerSession.handleFailures(getLog(), ignoreFailures);
    }