[ 
https://jira.codehaus.org/browse/MENFORCER-220?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=359417#comment-359417
 ] 

Konrad Windszus commented on MENFORCER-220:
-------------------------------------------

In my own enforcer rule I want to check if the rule is executed in a certain 
livecycle phase. If that is not the case I want to throw an exception. 
Currently there is no way to check in a custom enforcer rule in which phase it 
is executed. Some enforcer rule only make sense in a certain lifecycle phase 
(i.e. after compile, if you want to do some bytecode analysis), therefore it 
would be good to check within the custom rule in which phase this is executed. 
This is mainly to prevent a wrong configuration in the pom.xml.

> Make real MojoExecution available through the EnforcerExpressionEvaluator
> -------------------------------------------------------------------------
>
>                 Key: MENFORCER-220
>                 URL: https://jira.codehaus.org/browse/MENFORCER-220
>             Project: Maven Enforcer Plugin
>          Issue Type: Bug
>    Affects Versions: 1.3.1
>            Reporter: Konrad Windszus
>
> Currently through the EnforcerExpressionEvaluator only the session and the 
> project are available. The MojoExecution (incl. the lifecyclePhase) is just 
> an empty default 
> (https://github.com/apache/maven-enforcer/blob/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/EnforcerExpressionEvaluator.java#L49).
>  Instead the real MojoExecution of the maven-enforcer-plugin should be made 
> available through the evaluator.
> My use case is that I want to check within a custom rule in which lifecycle 
> the rule was executed. This is currently not possible since the livecycle 
> phase is always null.



--
This message was sent by Atlassian JIRA
(v6.1.6#6162)

Reply via email to