Class XmlCheckPlugin

java.lang.Object
org.apache.maven.plugin.AbstractMojo
au.com.acegi.xmlformat.AbstractXmlPlugin
au.com.acegi.xmlformat.XmlCheckPlugin
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

@Mojo(name="xml-check", defaultPhase=PROCESS_SOURCES, threadSafe=true) public final class XmlCheckPlugin extends AbstractXmlPlugin
Finds the XML files in a project and only check them: no files are changed, but the build will fail if any file does not follow the formatting conventions.
  • Constructor Details

    • XmlCheckPlugin

      public XmlCheckPlugin()
  • Method Details

    • processFile

      protected boolean processFile(File input, XmlOutputFormat fmt) throws org.dom4j.DocumentException, IOException
      Description copied from class: AbstractXmlPlugin
      Processes a single file found in the project.
      Specified by:
      processFile in class AbstractXmlPlugin
      Parameters:
      input - the file to process
      fmt - the formatting options
      Returns:
      true if the file required changes to match the formatting style
      Throws:
      org.dom4j.DocumentException - if input XML could not be parsed
      IOException - if output XML stream could not be written
    • afterAllProcessed

      protected void afterAllProcessed(boolean neededFormatting) throws org.apache.maven.plugin.MojoExecutionException
      Description copied from class: AbstractXmlPlugin
      Invoked after all files in the project have been processed.
      Specified by:
      afterAllProcessed in class AbstractXmlPlugin
      Parameters:
      neededFormatting - whether any processed file required changes to match the formatting style
      Throws:
      org.apache.maven.plugin.MojoExecutionException - if the build must be failed