You can change the phase the execution is bound to to put it in the
process-classes phase if your rule needs to validate the classes

On Wed, 20 Mar 2019 at 15:43, Elliotte Rusty Harold <[email protected]>
wrote:

> Yesterday one of our developers uncovered a major architectural flaw
> in one of our projects. Before we back up and do something different I
> want to make sure our current thoughts are accurate.
>
> As best we can tell it seems that Maven enforcer rules cannot read the
> code from the current project (the one whose pom.xml includes the
> enforcer rule) because enforcer rules execute in the validation phase
> before the project is compiled.
>
> Is this accurate or is there some way we could execute the enforcer
> rule in the verify phase instead? Or somehow have access to the
> current compiled source code from the validate phase?
>
> If not, we're probably going to have to rewrite our enforcer rule as
> an independent maven plugin.
>
> --
> Elliotte Rusty Harold
> [email protected]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to