Package com.qulice.maven
Class DefaultMavenEnvironment
java.lang.Object
com.qulice.maven.DefaultMavenEnvironment
- All Implemented Interfaces:
Environment
Environment, passed from MOJO to validators.
- Since:
- 0.3
- Suppressed Checkstyle violations:
- ClassDataAbstractionCouplingCheck (300 lines)
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.qulice.spi.Environment
Environment.Mock -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionasserts()basedir()Get project's basedir.Get classloader for this project.Get list of paths in classpath.config()org.codehaus.plexus.context.Contextcontext()encoding()Encoding for the files.booleanShall this item be excluded from report?List of exclude patterns for given checker.executor()Returns the files matching the specified pattern.outdir()Get directory where .class files are stored.Get parameter by name, and return default if it's not set.org.apache.maven.project.MavenProjectproject()voidsetAssertion(Collection<String> ass) Set list of Xpath queries for pom.xml validation.voidsetContext(org.codehaus.plexus.context.Context ctx) Set context.voidsetEncoding(String encoding) voidsetExcludes(Collection<String> exprs) Set list of regular expressions to exclude.voidsetMojoExecutor(MojoExecutor exec) Set executor.voidsetProject(org.apache.maven.project.MavenProject proj) Set Maven Project (used mostly for unit testing).voidsetProperty(String name, String value) Set property.tempdir()Get directory to keep temporary files in.
-
Constructor Details
-
DefaultMavenEnvironment
public DefaultMavenEnvironment()
-
-
Method Details
-
param
Description copied from interface:EnvironmentGet parameter by name, and return default if it's not set.- Specified by:
paramin interfaceEnvironment- Parameters:
name- The name of parametervalue- Default value to return as default- Returns:
- The value
-
basedir
Description copied from interface:EnvironmentGet project's basedir.- Specified by:
basedirin interfaceEnvironment- Returns:
- The directory
-
tempdir
Description copied from interface:EnvironmentGet directory to keep temporary files in.- Specified by:
tempdirin interfaceEnvironment- Returns:
- The directory
-
outdir
Description copied from interface:EnvironmentGet directory where .class files are stored.- Specified by:
outdirin interfaceEnvironment- Returns:
- The directory
-
classpath
Description copied from interface:EnvironmentGet list of paths in classpath.- Specified by:
classpathin interfaceEnvironment- Returns:
- The collection of paths
-
classloader
Description copied from interface:EnvironmentGet classloader for this project.- Specified by:
classloaderin interfaceEnvironment- Returns:
- The classloader
-
project
public org.apache.maven.project.MavenProject project() -
properties
-
context
public org.codehaus.plexus.context.Context context() -
config
-
executor
-
asserts
-
files
Description copied from interface:EnvironmentReturns the files matching the specified pattern.The pattern matching scheme used is wildcard matching. The characters '?' and '*' represents single or multiple wildcard characters, respectively. Pattern matching is case sensitive.
- Specified by:
filesin interfaceEnvironment- Parameters:
pattern- File name pattern- Returns:
- Collection of files, matching the specified pattern
-
exclude
Description copied from interface:EnvironmentShall this item be excluded from report?- Specified by:
excludein interfaceEnvironment- Parameters:
check- Name of the check that is askingname- File or any other item, which is subject of validation- Returns:
- TRUE if it should be ignored
-
excludes
Description copied from interface:EnvironmentList of exclude patterns for given checker. Each list element will contain exactly one exclude pattern which, depending on the plugin that uses the excludes might be either wildcard (CodeNarc) pattern or regex pattern (FindBugs).- Specified by:
excludesin interfaceEnvironment- Parameters:
checker- Name of the checker that is asking (pmd, codenarc ...)- Returns:
- Exclude patterns
-
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
Set executor.- Parameters:
exec- The executor
-
setProperty
Set property.- Parameters:
name- Its namevalue- Its value
-
setExcludes
Set list of regular expressions to exclude.- Parameters:
exprs- Expressions
-
setAssertion
Set list of Xpath queries for pom.xml validation.- Parameters:
ass- Xpath queries
-
setEncoding
-
encoding
Description copied from interface:EnvironmentEncoding for the files.- Specified by:
encodingin interfaceEnvironment- Returns:
- Source files charset
-