public void prepare()

in src/main/java/org/apache/tomee/website/Sources.java [122:166]


    public void prepare() {
        final Docs docs = new Docs(this);
        final Javadocs javadocs = new Javadocs(this);
        final Examples examples = new Examples(this);
        final VersionIndex versionIndex = new VersionIndex(this);
        final LearningLinks learningLinks = new LearningLinks(examples);
        final Jakartize jakartize = new Jakartize();
        final TomEEVersionReplacement versionReplacement = new TomEEVersionReplacement();

        try {
            IO.copyDirectory(mainSource, jbake);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

        // Download the git repo associated with each Source
        // including any related Source/git repos
        sources.stream()
                .flatMap(Source::stream)
                .peek(source -> source.setDir(new File(repos, source.getName())))
                .forEach(Repos::download);

        // Run any initial steps to process each
        // source root (excluding the related repos)
        sources.stream()
                .peek(jakartize::prepare)
                .peek(versionReplacement::prepare)
                .peek(docs::prepare)
                .peek(javadocs::prepare)
                .peek(examples::prepare)
                .peek(versionIndex::prepare)
                .peek(learningLinks::prepare)
                .forEach(Sources::prepared);

        // Run any final tasks that have been registered
        // with any Source instance during the prepare phase
        sources.stream()
                .flatMap(Source::stream)
                .map(Source::getPerform)
                .flatMap(Collection::stream)
                .peek(runnable -> System.out.println("Running Hook " + runnable))
                .forEach(Runnable::run);

        VersionsIndex.prepare(this);
    }