Package net.revelc.code.formatter
Class ValidateMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- net.revelc.code.formatter.FormatterMojo
-
- net.revelc.code.formatter.ValidateMojo
-
- All Implemented Interfaces:
net.revelc.code.formatter.ConfigurationSource
,org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
@Mojo(name="validate", defaultPhase=VALIDATE, requiresProject=true, threadSafe=true) public class ValidateMojo extends FormatterMojo
This mojo is very similar to Formatter mojo, but it is focused on CI servers. If the code ain't formatted as expected this mojo will fail the build- Author:
- marvin.froeder
-
-
Constructor Summary
Constructors Constructor Description ValidateMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doFormatFile(File file, net.revelc.code.formatter.FormatterMojo.ResultCollector rc, Properties hashCache, String basedirPath, boolean dryRun)
Format individual file.void
execute()
Execute.-
Methods inherited from class net.revelc.code.formatter.FormatterMojo
getCompilerCodegenTargetPlatform, getCompilerCompliance, getCompilerSources, getEncoding, getTargetDirectory
-
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
-
-
-
Method Detail
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
Description copied from class:FormatterMojo
Execute.- Specified by:
execute
in interfaceorg.apache.maven.plugin.Mojo
- Overrides:
execute
in classFormatterMojo
- Throws:
org.apache.maven.plugin.MojoExecutionException
- the mojo execution exceptionorg.apache.maven.plugin.MojoFailureException
- the mojo failure exception- See Also:
Mojo.execute()
-
doFormatFile
protected void doFormatFile(File file, net.revelc.code.formatter.FormatterMojo.ResultCollector rc, Properties hashCache, String basedirPath, boolean dryRun) throws IOException, org.apache.maven.plugin.MojoFailureException, org.eclipse.jface.text.BadLocationException, org.apache.maven.plugin.MojoExecutionException
Description copied from class:FormatterMojo
Format individual file.- Overrides:
doFormatFile
in classFormatterMojo
- Parameters:
file
- the filerc
- the rchashCache
- the hash cachebasedirPath
- the basedir pathdryRun
- the dry run- Throws:
IOException
- Signals that an I/O exception has occurred.org.apache.maven.plugin.MojoFailureException
- the mojo failure exceptionorg.eclipse.jface.text.BadLocationException
- the bad location exceptionorg.apache.maven.plugin.MojoExecutionException
- the mojo execution exception
-
-