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

com.github.eirslett.maven.plugins.frontend.mojo.KarmaRunMojo Maven / Gradle / Ivy

Go to download

This Maven plugin lets you install Node/NPM locally for your project, install dependencies with NPM, install dependencies with bower or jspm, run Grunt or gulp tasks, and/or run Karma tests.

The newest version!
package com.github.eirslett.maven.plugins.frontend.mojo;

import com.github.eirslett.maven.plugins.frontend.lib.FrontendPluginFactory;
import com.github.eirslett.maven.plugins.frontend.lib.TaskRunnerException;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;


@Mojo(name="karma",  defaultPhase = LifecyclePhase.TEST, threadSafe = true)
public final class KarmaRunMojo extends AbstractFrontendMojo {

    /**
     * Path to your karma configuration file, relative to the working directory (default is "karma.conf.js")
     */
    @Parameter(defaultValue = "karma.conf.js", property = "karmaConfPath")
    private String karmaConfPath;

    /**
     * Skips execution of this mojo.
     */
    @Parameter(property = "skip.karma", defaultValue = "${skip.karma}")
    private boolean skip;

    @Override
    protected boolean skipExecution() {
        return this.skip;
    }

    @Override
    public synchronized void execute(FrontendPluginFactory factory) throws TaskRunnerException {
        factory.getKarmaRunner().execute("start " + karmaConfPath, environmentVariables);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy