maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Jackson (JIRA)" <j...@codehaus.org>
Subject [jira] Commented: (MENFORCER-31) Incorrect documentation for writing a custom rule
Date Thu, 18 Sep 2008 15:38:48 GMT

    [ http://jira.codehaus.org/browse/MENFORCER-31?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=148343#action_148343
] 

Brian Jackson commented on MENFORCER-31:
----------------------------------------

Our builds started failing today because Maven updated to the latest enforcer release 1.0-alpha-4
and we have a custom rule.  The error is an ArrayStoreException.  Is the 1.0-alpha-4 finally
matching the documentation and org.apache.maven.enforcer.rule.api.EnforcerRule is now the
correct interface to implement?  If true, that's a pretty significant change that wasn't documented
in the release notes that is guaranteed to break builds for anyone using the enforcer plugin
and not using an explicit version.

Also the release notes for 1.0-alpha-4 imply there is a noSnapshots standard rule but its
not yet documented here:  http://maven.apache.org/enforcer/enforcer-rules/index.html
I ask because my custom rule that broke with 1.0-alpha-4 duplicates this functionality and
I'd rather just used the standard rule if its available now.

> 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
>             Fix For: 1.0
>
>
> 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

        

Mime
View raw message