Package io.spring.format.maven
Class FormatMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
io.spring.format.maven.FormatMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
ApplyMojo,ValidateMojo
public abstract class FormatMojo
extends org.apache.maven.plugin.AbstractMojo
Base class for formatter Mojo.
- Author:
- Phillip Webb
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.maven.project.MavenProjectThe Maven Project Object.protected org.apache.maven.execution.MavenSessionThe Maven Session Object.Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidexecute()protected abstract voidPerform the formatting build-process behavior thisMojoimplements.protected final FileFormatterprotected booleanMethods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
project
@Parameter(defaultValue="${project}", readonly=true, required=true) protected org.apache.maven.project.MavenProject projectThe Maven Project Object. -
session
@Parameter(defaultValue="${session}", readonly=true, required=true) protected org.apache.maven.execution.MavenSession sessionThe Maven Session Object.
-
-
Constructor Details
-
FormatMojo
public FormatMojo()
-
-
Method Details
-
execute
public final void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
execute
protected abstract void execute(List<File> files, Charset encoding, String lineSeparator) throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException Perform the formatting build-process behavior thisMojoimplements.- Parameters:
files- the files to processencoding- the encodinglineSeparator- the line separator- Throws:
org.apache.maven.plugin.MojoExecutionException- on execution errororg.apache.maven.plugin.MojoFailureException- on failure
-
getFormatter
-
skipGlobally
protected boolean skipGlobally()
-