Class RequireEncoding
java.lang.Object
org.apache.maven.enforcer.rule.api.AbstractEnforcerRule
org.codehaus.mojo.extraenforcer.encoding.RequireEncoding
- All Implemented Interfaces:
org.apache.maven.enforcer.rule.api.EnforcerRuleBase
@Named("requireEncoding")
public class RequireEncoding
extends org.apache.maven.enforcer.rule.api.AbstractEnforcerRule
Checks file encodings to see if they match the project.build.sourceEncoding If file encoding can not be determined it
is skipped.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
Should the rule accept US-ASCII as an subset of UTF-8 and ISO-8859-1/-15.private boolean
Should the rule accept ISO-8859-1 as a subset of ISO-8859-15.private String
Validate files match this encoding.private String
Comma (or pipe) separated list of globs do exclude.private boolean
Should the rule fail after the first error or should the errors be aggregated.private String
Comma (or pipe) separated list of globs do include.private static final String
private final org.apache.maven.project.MavenProject
private boolean
Enables SCM files exclusions. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
execute()
protected String
getEncoding
(File file) org.apache.maven.enforcer.rule.api.EnforcerLogger
getLog()
boolean
void
setEncoding
(String encoding) void
setExcludes
(String excludes) void
setIncludes
(String includes) void
setLog
(org.apache.maven.enforcer.rule.api.EnforcerLogger arg0) void
setUseDefaultExcludes
(boolean useDefaultExcludes) Methods inherited from class org.apache.maven.enforcer.rule.api.AbstractEnforcerRule
getCacheId, getLevel
-
Field Details
-
ISO_8859_15
- See Also:
-
encoding
Validate files match this encoding. If not specified then default to ${project.build.sourceEncoding}. -
includes
Comma (or pipe) separated list of globs do include. -
excludes
Comma (or pipe) separated list of globs do exclude. -
useDefaultExcludes
private boolean useDefaultExcludesEnables SCM files exclusions. Enabled by default. -
failFast
private boolean failFastShould the rule fail after the first error or should the errors be aggregated. -
acceptAsciiSubset
private boolean acceptAsciiSubsetShould the rule accept US-ASCII as an subset of UTF-8 and ISO-8859-1/-15. -
acceptIso8859Subset
private boolean acceptIso8859SubsetShould the rule accept ISO-8859-1 as a subset of ISO-8859-15. -
project
private final org.apache.maven.project.MavenProject project
-
-
Constructor Details
-
RequireEncoding
@Inject public RequireEncoding(org.apache.maven.project.MavenProject project)
-
-
Method Details
-
execute
public void execute() throws org.apache.maven.enforcer.rule.api.EnforcerRuleException- Specified by:
execute
in classorg.apache.maven.enforcer.rule.api.AbstractEnforcerRule
- Throws:
org.apache.maven.enforcer.rule.api.EnforcerRuleException
-
getEncoding
- Throws:
IOException
-
getEncoding
-
setEncoding
-
getIncludes
-
setIncludes
-
getExcludes
-
setExcludes
-
isUseDefaultExcludes
public boolean isUseDefaultExcludes() -
setUseDefaultExcludes
public void setUseDefaultExcludes(boolean useDefaultExcludes) -
setLog
public void setLog(org.apache.maven.enforcer.rule.api.EnforcerLogger arg0) - Specified by:
setLog
in interfaceorg.apache.maven.enforcer.rule.api.EnforcerRuleBase
-
getLog
public org.apache.maven.enforcer.rule.api.EnforcerLogger getLog()
-