Class RequirePrerequisite
java.lang.Object
org.apache.maven.enforcer.rule.api.AbstractEnforcerRuleBase
org.apache.maven.enforcer.rule.api.AbstractEnforcerRule
org.apache.maven.enforcer.rules.AbstractStandardEnforcerRule
org.apache.maven.enforcer.rules.RequirePrerequisite
- All Implemented Interfaces:
EnforcerRuleBase
@Named("requirePrerequisite")
public final class RequirePrerequisite
extends AbstractStandardEnforcerRule
- Since:
- 1.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringCan either be version or a range, e.g.Only the projects with one of these packagings will be enforced to have the correct prerequisite.private final org.apache.maven.project.MavenProject -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()This is the interface into the rule.voidsetMavenVersion(String mavenVersion) Set the mavenVersion Can either be version or a range, e.g.voidsetPackagings(List<String> packagings) Only the projects with one of these packagings will be enforced to have the correct prerequisite.toString()Methods inherited from class AbstractStandardEnforcerRule
formatLocation, getMessage, setMessageMethods inherited from class AbstractEnforcerRule
getCacheId, getLevel, getRuleNameMethods inherited from class AbstractEnforcerRuleBase
getLog, setLog
-
Field Details
-
packagings
-
mavenVersion
Can either be version or a range, e.g.2.2.1or[2.2.1,) -
project
private final org.apache.maven.project.MavenProject project
-
-
Constructor Details
-
RequirePrerequisite
@Inject public RequirePrerequisite(org.apache.maven.project.MavenProject project)
-
-
Method Details
-
setMavenVersion
Set the mavenVersion Can either be version or a range, e.g.2.2.1or[2.2.1,)- Parameters:
mavenVersion- the version ornull
-
setPackagings
-
execute
Description copied from class:AbstractEnforcerRuleThis is the interface into the rule. This method should throw an exception containing a reason message if the rule fails the check. The plugin will then decide based on the fail flag and rule level if it should stop or just log the message as a warning.- Specified by:
executein classAbstractEnforcerRule- Throws:
EnforcerRuleException- the enforcer rule exception
-
toString
-