Incorrect documentation for writing a custom rule
-------------------------------------------------
Key: MENFORCER-31
URL: http://jira.codehaus.org/browse/MENFORCER-31
Project: Maven 2.x Enforcer Plugin
Issue Type: Bug
Components: Rule API
Affects Versions: 1.0-alpha-3
Reporter: Ben Lidgey
Assignee: Brian Fox
The documentation at
http://maven.apache.org/enforcer/enforcer-api/writing-a-custom-rule.html has
the wrong dependencies and code examples for creating a custom rule.
It defines
{code:xml}
<dependency>
<groupId>org.apache.maven.enforcer</groupId>
<artifactId>enforcer-api</artifactId>
<version>${api.version}</version>
</dependency>
{code}
instead of
{code:xml}
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-enforcer-rule-api</artifactId>
<version>1.0-alpha-2</version>
</dependency>
{code}
and so the code examples are incorrect because:
# Incorrect imports:
#* The imports are for
#** {{org.apache.maven.enforcer.rule.api.EnforcerRule}}
#** {{org.apache.maven.enforcer.rule.api.EnforcerRuleException}}
#** {{org.apache.maven.enforcer.rule.api.EnforcerRuleHelper}}
#* instead of
#** {{org.apache.maven.shared.enforcer.rule.api.EnforcerRule}}
#** {{org.apache.maven.shared.enforcer.rule.api.EnforcerRuleException}}
#** {{org.apache.maven.shared.enforcer.rule.api.EnforcerRuleHelper}}.
#* Implementing {{import org.apache.maven.enforcer.rule.api.EnforcerRule}}
causes the custom plugin invocation to fail with an ArrayStoreException as the
expected type is {{import
org.apache.maven.shared.enforcer.rule.api.EnforcerRule}} instead.
# It shows implementing {{public String getCacheId()}}, {{public boolean
isCacheable()}}, {{public boolean isResultValid( EnforcerRule arg0 )}} which
are no longer needed.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira