com.github.albanseurat.springboot.plugin.RunBuildMojo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spring-boot-frontend-maven-plugin Show documentation
Show all versions of spring-boot-frontend-maven-plugin Show documentation
Allow to create a front-end project with AngularJS / bootstrap and grunt for proper build
The newest version!
package com.github.albanseurat.springboot.plugin;
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;
import static java.util.Optional.ofNullable;
@Mojo(name = "build", defaultPhase = LifecyclePhase.COMPILE)
public class RunBuildMojo extends AbstractMojo {
@Parameter(defaultValue = "${basedir}/src/main/web", property = "workingDirectory", required = false)
protected File workingDirectory;
@Parameter(property = "gruntFile", readonly = false)
protected String gruntFile;
@Parameter(property = "arguments")
protected String arguments;
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
final GruntTaskRunner taskRunner = new GruntTaskRunner(workingDirectory, ofNullable(arguments), ofNullable(gruntFile).map(File::new));
taskRunner.runTask("default");
}
}