org.xwiki.tool.enforcer
Class ValidateDependencyVersion
java.lang.Object
org.xwiki.tool.enforcer.ValidateDependencyVersion
- All Implemented Interfaces:
- org.apache.maven.enforcer.rule.api.EnforcerRule
public class ValidateDependencyVersion
- extends Object
- implements org.apache.maven.enforcer.rule.api.EnforcerRule
Performs checks on the version specified for dependencies in pom.xml files.
For example if we're in XWiki Rendering and there's a dependency on some XWiki Commons module we might want to
ensure that it uses a variable (such as ${commons.version}) and not ${project.version}. To achieve
this you would use:
<rules>
<validateDependencyVersion implementation="org.xwiki.tool.enforcer.ValidateDependencyVersion">
<versionCheck>
<groupIdPrefix>org.xwiki.commons</groupIdPrefix>
<allowedVersionRegex>\$\{project.version\}|[^$].*</allowedVersionRegex>
</versionCheck>
</validateDependencyVersion>
</rules>
- Since:
- 4.5RC1
- Version:
- $Id: 48fb3b635284d84f5fa905029f61bd62265edd41 $
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ValidateDependencyVersion
public ValidateDependencyVersion()
addVersionCheck
public void addVersionCheck(VersionCheck versionCheck)
- Add a new dependency version check. Called automatically by the Maven framework when the following construct
is defined in a pom.xml file:
<versionCheck>
<groupIdPrefix>org.xwiki.commons</groupIdPrefix>
<allowedVersionRegex>.*</allowedVersionRegex>
</versionCheck>
- Parameters:
versionCheck - the check to add
execute
public void execute(org.apache.maven.enforcer.rule.api.EnforcerRuleHelper helper)
throws org.apache.maven.enforcer.rule.api.EnforcerRuleException
- Specified by:
execute in interface org.apache.maven.enforcer.rule.api.EnforcerRule
- Throws:
org.apache.maven.enforcer.rule.api.EnforcerRuleException
isCacheable
public boolean isCacheable()
- Specified by:
isCacheable in interface org.apache.maven.enforcer.rule.api.EnforcerRule
isResultValid
public boolean isResultValid(org.apache.maven.enforcer.rule.api.EnforcerRule enforcerRule)
- Specified by:
isResultValid in interface org.apache.maven.enforcer.rule.api.EnforcerRule
getCacheId
public String getCacheId()
- Specified by:
getCacheId in interface org.apache.maven.enforcer.rule.api.EnforcerRule
Copyright © 2004–2014 XWiki. All rights reserved.