Class DefaultMavenEnvironment

  • All Implemented Interfaces:
    Environment

    public final class DefaultMavenEnvironment
    extends Object
    Environment, passed from MOJO to validators.
    Since:
    0.3
    Suppressed Checkstyle violations:
    ClassDataAbstractionCouplingCheck (300 lines)
    • Constructor Detail

      • DefaultMavenEnvironment

        public DefaultMavenEnvironment()
    • Method Detail

      • project

        public org.apache.maven.project.MavenProject project()
      • context

        public org.codehaus.plexus.context.Context context()
      • setProject

        public void setProject​(org.apache.maven.project.MavenProject proj)
        Set Maven Project (used mostly for unit testing).
        Parameters:
        proj - The project to set
      • setContext

        public void setContext​(org.codehaus.plexus.context.Context ctx)
        Set context.
        Parameters:
        ctx - The context to set
      • setMojoExecutor

        public void setMojoExecutor​(MojoExecutor exec)
        Set executor.
        Parameters:
        exec - The executor
      • setProperty

        public void setProperty​(String name,
                                String value)
        Set property.
        Parameters:
        name - Its name
        value - Its value
      • setExcludes

        public void setExcludes​(Collection<String> exprs)
        Set list of regular expressions to exclude.
        Parameters:
        exprs - Expressions
      • setAsser

        public void setAsser​(Collection<String> ass)
        Set list of Xpath queries for pom.xml validation.
        Parameters:
        ass - Xpath queries
      • setEncoding

        public void setEncoding​(String encoding)
      • encoding

        public Charset encoding()
        Get source files encoding.
        Specified by:
        encoding in interface Environment
        Returns:
        Charset of the source files