public void execute()

in src/main/java/org/apache/maven/plugin/docck/AbstractCheckDocumentationMojo.java [120:201]


    public void execute()
        throws MojoExecutionException, MojoFailureException
    {

        String httpUserAgent = "maven-docck-plugin/1.x" + " (Java " + System.getProperty( "java.version" ) + "; "
                + System.getProperty( "os.name" ) + " " + System.getProperty( "os.version" ) + ")";
        HttpClientBuilder httpClientBuilder = HttpClients.custom()
              .setDefaultRequestConfig( RequestConfig.custom()
                      .setConnectTimeout( Timeout.ofSeconds( 5 ) )
                      .setResponseTimeout( Timeout.ofSeconds( 5 ) )
                      .setCookieSpec( StandardCookieSpec.STRICT )
                      .build() )
              .setDefaultHeaders( singletonList( new BasicHeader( HttpHeaders.USER_AGENT, httpUserAgent ) ) );

        setupProxy( httpClientBuilder );

        httpClient = httpClientBuilder.build();

        if ( output != null )
        {
            getLog().info( "Writing documentation check results to: " + output );
        }

        Map<MavenProject, DocumentationReporter> reporters = new LinkedHashMap<>();
        boolean hasErrors = false;

        for ( MavenProject project : reactorProjects )
        {
            if ( approveProjectPackaging( project.getPackaging() ) )
            {
                getLog().info( "Checking project: " + project.getName() );

                DocumentationReporter reporter = new DocumentationReporter();

                checkProject( project, reporter );

                if ( !hasErrors && reporter.hasErrors() )
                {
                    hasErrors = true;
                }

                reporters.put( project, reporter );
            }
            else
            {
                getLog().info( "Skipping unsupported project: " + project.getName() );
            }
        }

        String messages;

        messages = buildErrorMessages( reporters );

        if ( !hasErrors )
        {
            messages += "No documentation errors were found.";
        }

        try
        {
            writeMessages( messages, hasErrors );
        }
        catch ( IOException e )
        {
            throw new MojoExecutionException( "Error writing results to output file: " + output );
        }

        if ( hasErrors )
        {
            String logLocation;
            if ( output == null )
            {
                logLocation = "Please see the console output above for more information.";
            }
            else
            {
                logLocation = "Please see \'" + output + "\' for more information.";
            }

            throw new MojoFailureException( "Documentation problems were found. " + logLocation );
        }
    }