protected void check()

in apache-rat-plugin/src/main/java/org/apache/rat/mp/RatCheckMojo.java [165:194]


    protected void check(ClaimStatistic statistics)
            throws MojoFailureException {
        if (numUnapprovedLicenses > 0) {
            getLog().info("You requested to accept " + numUnapprovedLicenses + " files with unapproved licenses.");
        }

        int numApproved = statistics.getNumApproved();
        getLog().info("Rat check: Summary over all files. Unapproved: " + statistics.getNumUnApproved() + //
                ", unknown: " + statistics.getNumUnknown() + //
                ", generated: " + statistics.getNumGenerated() + //
                ", approved: " + numApproved + //
                (numApproved > 0 ? " licenses." : " license."));

        if (numUnapprovedLicenses < statistics.getNumUnApproved()) {
            if (consoleOutput) {
                try {
                    getLog().warn(createReport(Defaults.getUnapprovedLicensesStyleSheet()).trim());
                } catch (MojoExecutionException e) {
                    getLog().warn("Unable to print the files with unapproved licenses to the console.");
                }
            }

            final String seeReport = " See RAT report in: " + reportFile;
            if (!ignoreErrors) {
                throw new RatCheckException("Too many files with unapproved license: " + statistics.getNumUnApproved() + seeReport);
            } else {
                getLog().warn("Rat check: " + statistics.getNumUnApproved() + " files with unapproved licenses." + seeReport);
            }
        }
    }