Class VerifierMojo

  • All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

    public class VerifierMojo
    extends org.apache.maven.plugin.AbstractMojo
    Verifies the existence or non-existence of files/directories and optionally checks file content against a regular expression.
    Version:
    $Id: VerifierMojo.java 900472 2010-01-18 17:36:37Z dennisl $
    • Field Detail

      • basedir

        private java.io.File basedir
        Project base directory (prepended to relative file paths).
      • verificationFile

        private java.io.File verificationFile
        The file containing the verifications to perform.
      • failOnError

        private boolean failOnError
        Whether the build will fail on verification errors.
    • Constructor Detail

      • VerifierMojo

        public VerifierMojo()
    • Method Detail

      • execute

        public void execute()
                     throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • getAbsoluteFileToCheck

        protected java.io.File getAbsoluteFileToCheck​(java.io.File file)
        Parameters:
        file - the file path of the file to check (can be relative or absolute). If relative the project's basedir will be prefixed.
        Returns:
        the absolute file path of the file to check
      • verify

        private VerificationResult verify()
                                   throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • verifyFile

        private boolean verifyFile​(File fileCheck,
                                   VerificationResult results)
                            throws java.io.IOException
        Throws:
        java.io.IOException
      • verifyFileContent

        private boolean verifyFileContent​(File fileCheck,
                                          VerificationResult results)
                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • setBaseDir

        public void setBaseDir​(java.io.File basedir)
      • setVerificationFile

        public void setVerificationFile​(java.io.File file)
      • setFailOnError

        public void setFailOnError​(boolean failOnError)