I confirmed my initial hunch but I'm not sure how to fix this the right way. 
Here's what is happening:

The rule gets the list of plugins bound by the default lifecycles (additional 
lifecycles may be specified) and additional Plugins specified by the user. It 
then gets the list of plugins specified in the poms by walking the inheritance 
tree and pulling plugins from build.plugins, build.pluginManagement, 
profiles.plugins, profiles.pluginManagement.  (I need to do this because I 
can't get at the original model...plugins already have versions resolved by 
this time, so I can't see what the user did or did not specify).

Here's the problem: during site execution, the report plugins are injected into 
the build.plugins list alongside the regular plugins. Since these plugins most 
likely will not also be specified in build.plugins or build.pluginManagement, 
the enforcer doesn't find the version and fails. 

The simple fix is then to just read the reporting section and check if the 
version is there, but this isn't really a correct analysis. If a plugin that 
can be used both as part of the build and as part of reports is used, it could 
have misleading results. For example if they only specify a version in the 
reporting section, the enforcer won't fail as it should since I can't tell the 
difference.

What I really need to do is only compare reporting plugins with the versions 
specified in the reporting section, but it appears that there is no obvious to 
tell when a plugin in the list is actually coming from the reporting section. I 
guess I could attempt to read all those sections and try to guess where it's 
from, but more reading of the raw poms isn't the best way.

Any other ideas?

-----Original Message-----
From: Arnaud HERITIER [mailto:[EMAIL PROTECTED] 
Sent: Friday, July 18, 2008 5:06 AM
To: Maven Developers List
Subject: Re: releasing the enforcer

ok thanks a lot.
I think we are numerous to wait for this release ;-)

Arnaud

On Fri, Jul 18, 2008 at 12:52 AM, Brian E. Fox <[EMAIL PROTECTED]>
wrote:

> I worked on it last night, I am able to reproduce it, but I haven't
> finished the code yet. I will work on it some more tonight.
>
> -----Original Message-----
> From: Arnaud HERITIER [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 17, 2008 4:54 PM
> To: Maven Developers List
> Subject: Re: releasing the enforcer
>
> Hi Brian,
>
>  Did you find the time to solve this one ?
>
>
> Arnaud
>
> On Mon, Jul 14, 2008 at 4:53 PM, Brian E. Fox <[EMAIL PROTECTED]>
> wrote:
>
> > Thanks Herve, that looks like the problem I saw before. I'll check this
> out
> > and get it into the Its.
> >
> > -----Original Message-----
> > From: Hervé BOUTEMY [mailto:[EMAIL PROTECTED]
> > Sent: Sunday, July 13, 2008 7:49 AM
> > To: Maven Developers List
> > Subject: Re: releasing the enforcer
> >
> > Le samedi 12 juillet 2008, Brian E. Fox a écrit :
> > > I'm not able to reproduce the report issue I saw previously, so I'm
> > > going to tidy up what's here and stage a release, hopefully this
> > > weekend. If anyone wants to try a snapshot and lock down plugins that
> > > has reports, please do...the issue I saw was that when running site,
> the
> > > plugin failed several reporting plugins saying they didn't have
> versions
> > > when they did.
> >
> > I'm able to reproduce it on my project, with Maven 2.0.9 and
> > maven-site-plugin
> > 2.0-beta-7:
> > [INFO] [enforcer:enforce {execution: enforce-versions}]
> > [WARNING] plugin org.apache.maven.plugins:maven-jxr-plugin not found
> > [WARNING] plugin org.apache.maven.plugins:maven-pmd-plugin not found
> > [WARNING] plugin org.apache.maven.plugins:maven-surefire-report-plugin
> not
> > found
> > [WARNING] plugin org.apache.maven.plugins:maven-javadoc-plugin not found
> > [WARNING] plugin org.codehaus.mojo:jdepend-maven-plugin not found
> > [WARNING] plugin org.codehaus.mojo:javancss-maven-plugin not found
> > [WARNING] plugin
> org.apache.maven.plugins:maven-project-info-reports-plugin
> > not found
> > [WARNING] plugin org.codehaus.mojo:findbugs-maven-plugin not found
> > [WARNING] plugin net.sf.dtddoc:dtddoc-maven-plugin not found
> > [WARNING] Rule 0: org.apache.maven.plugins.enforcer.RequirePluginVersions
> > failed with message:
> > Some plugins are missing valid versions:(LATEST RELEASE SNAPSHOT are not
> > allowed )
> > org.apache.maven.plugins:maven-jxr-plugin.      The version currently in
> > use
> > is 2.1
> > org.apache.maven.plugins:maven-pmd-plugin.      The version currently in
> > use
> > is 2.2
> > org.apache.maven.plugins:maven-surefire-report-plugin.  The version
> > currently
> > in use is 2.3
> > org.apache.maven.plugins:maven-javadoc-plugin.  The version currently in
> > use
> > is 2.3
> > org.codehaus.mojo:jdepend-maven-plugin.         The version currently in
> > use
> > is 2.0-beta-1
> > org.codehaus.mojo:javancss-maven-plugin.        The version currently in
> > use
> > is 2.0-beta-2
> > org.apache.maven.plugins:maven-project-info-reports-plugin.     The
> version
> > currently in use is 2.1-SNAPSHOT
> > org.codehaus.mojo:findbugs-maven-plugin.        The version currently in
> > use
> > is 1.1.1
> > org.apache.maven.plugins:maven-enforcer-plugin.         The version
> > currently
> > in use is 1.0-SNAPSHOT
> > net.sf.dtddoc:dtddoc-maven-plugin.      The version currently in use is
> 1.1
> >
> > the project is here:
> > http://logdistiller.sourceforge.net/source-repository.html
> > (the enforcer is commented out since it is a SNAPSHOT)
> >
> > regards,
> >
> > Hervé
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to