All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.thucydides.maven.plugins.ThucydidesCleanMojo Maven / Gradle / Ivy

There is a newer version: 0.9.275
Show newest version
package net.thucydides.maven.plugins;

import net.thucydides.core.reports.html.HtmlAggregateStoryReporter;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.project.MavenProject;

/**
 * This plugin deletes existing history files for Thucydides for this project.
 * @goal clean
 */
public class ThucydidesCleanMojo extends AbstractMojo {
    /**
     * @parameter expression="${project}"
     * @required
     * @readonly
     */
    protected MavenProject project;

    private HtmlAggregateStoryReporter reporter;

    private ThucydidesHTMLReportGenerator htmlReportGenerator;

    protected HtmlAggregateStoryReporter getReporter() {
        if (reporter == null) {
            reporter = new HtmlAggregateStoryReporter(MavenProjectHelper.getProjectIdentifier(project));
        }
        return reporter;

    }

    public void execute() throws MojoExecutionException, MojoFailureException {
        getLog().info("Clearing Thucydides historical reports");
        getReporter().clearHistory();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy