Package org.apache.maven.enforcer.rules
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 String
Can 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 TypeMethodDescriptionvoid
execute()
This is the interface into the rule.void
setMavenVersion
(String mavenVersion) Set the mavenVersion Can either be version or a range, e.g.void
setPackagings
(List<String> packagings) Only the projects with one of these packagings will be enforced to have the correct prerequisite.toString()
Methods inherited from class org.apache.maven.enforcer.rules.AbstractStandardEnforcerRule
formatLocation, getMessage, setMessage
Methods inherited from class org.apache.maven.enforcer.rule.api.AbstractEnforcerRule
getCacheId, getLevel
Methods inherited from class org.apache.maven.enforcer.rule.api.AbstractEnforcerRuleBase
getLog, setLog
-
Field Details
-
packagings
Only the projects with one of these packagings will be enforced to have the correct prerequisite.- Since:
- 1.4
-
mavenVersion
Can either be version or a range, e.g.2.2.1
or[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.1
or[2.2.1,)
- Parameters:
mavenVersion
- the version ornull
-
setPackagings
Only the projects with one of these packagings will be enforced to have the correct prerequisite.- Parameters:
packagings
- the list of packagings- Since:
- 1.4
-
execute
Description copied from class:AbstractEnforcerRule
This 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:
execute
in classAbstractEnforcerRule
- Throws:
EnforcerRuleException
- the enforcer rule exception
-
toString
-