protected void renderBody()

in src/main/java/org/apache/maven/report/projectinfo/ModulesReport.java [150:212]


        protected void renderBody() {
            List<String> modules = project.getModel().getModules();

            if (modules == null || modules.isEmpty()) {
                startSection(getTitle());

                paragraph(getI18nString("nolist"));

                endSection();

                return;
            }

            startSection(getTitle());

            paragraph(getI18nString("intro"));

            startTable();

            String name = getI18nString("header.name");
            String description = getI18nString("header.description");
            tableHeader(new String[] {name, description});

            final String baseUrl = getDistMgmntSiteUrl(project);

            ProjectBuildingRequest buildingRequest = new DefaultProjectBuildingRequest(this.buildingRequest);
            buildingRequest.setLocalRepository(localRepository);
            buildingRequest.setProcessPlugins(false);

            for (String module : modules) {
                MavenProject moduleProject = getModuleFromReactor(project, reactorProjects, module);

                if (moduleProject == null) {
                    log.warn("Module " + module + " not found in reactor: loading locally");

                    File f = new File(project.getBasedir(), module + "/pom.xml");
                    if (f.exists()) {
                        try {
                            moduleProject =
                                    projectBuilder.build(f, buildingRequest).getProject();
                        } catch (ProjectBuildingException e) {
                            throw new IllegalStateException("Unable to read local module POM", e);
                        }
                    } else {
                        moduleProject = new MavenProject();
                        moduleProject.setName(module);
                        moduleProject.setDistributionManagement(new DistributionManagement());
                        moduleProject.getDistributionManagement().setSite(new Site());
                        moduleProject.getDistributionManagement().getSite().setUrl(module);
                    }
                }
                final String moduleName =
                        (moduleProject.getName() == null) ? moduleProject.getArtifactId() : moduleProject.getName();
                final String moduleHref =
                        getRelativeLink(baseUrl, getDistMgmntSiteUrl(moduleProject), moduleProject.getArtifactId());

                tableRow(new String[] {linkedName(moduleName, moduleHref), moduleProject.getDescription()});
            }

            endTable();

            endSection();
        }