Class 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 Detail

      • project

        @Parameter(defaultValue="${project}",
                   readonly=true,
                   required=true)
        protected org.apache.maven.project.MavenProject project
        The Maven Project Object.
    • Constructor Detail

      • FormatMojo

        public FormatMojo()
    • Method Detail

      • execute

        public final void execute()
                           throws org.apache.maven.plugin.MojoExecutionException,
                                  org.apache.maven.plugin.MojoFailureException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
        org.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 this Mojo implements.
        Parameters:
        files - the files to process
        encoding - the encoding
        lineSeparator - the line separator
        Throws:
        org.apache.maven.plugin.MojoExecutionException - on execution error
        org.apache.maven.plugin.MojoFailureException - on failure