com.github.eirslett.maven.plugins.frontend.mojo.JspmMojo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of frontend-maven-plugin Show documentation
Show all versions of frontend-maven-plugin Show documentation
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.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import java.io.File;
@Mojo(name="jspm", defaultPhase = LifecyclePhase.GENERATE_RESOURCES, threadSafe = true)
public class JspmMojo extends AbstractFrontendMojo {
/**
* JSPM arguments. Default is "install".
*/
@Parameter(defaultValue = "install", property = "frontend.bower.arguments", required = false)
private String arguments;
/**
* Skips execution of this mojo.
*/
@Parameter(property = "skip.jspm", defaultValue = "${skip.jspm}")
private boolean skip;
@Override
protected boolean skipExecution() {
return this.skip;
}
@Override
protected synchronized void execute(FrontendPluginFactory factory) throws TaskRunnerException {
factory.getJspmRunner().execute(arguments, environmentVariables);
}
}