There is only one issue with this mojo at the moment (that I can see)

It only checks plugins that are bound.

If you have a pluginManagement section in your pom, that plugin management
section is not checked.

So, say for example you have the maven-idea-plugin defined in your plugin
management section, but not defined in the plugins section of your build
(because you want to specify the default goal _if it is executed_ but don't
want to force execution)

In that scenario, you won't be notified of updates for that plugin.

I tried using Project.getPluginManagement().getPlugins()... but that
includes all the plugins from the super pom... so for Maven 2.0.9 you get
told about new versions of plugins you are not using.

What I'll need to do is parse the pom directly and see what's in the
pluginManagement section myself, as that's what really mattters

-Stephen

On Fri, Aug 15, 2008 at 9:52 AM, Stephen Connolly <
[EMAIL PROTECTED]> wrote:

> Jusrt checking in the display-plugin-updates mojo to the versions plugin.
> The apply-plugin-updates is a bit tricker as we have to find the
> pluginManagement sections if necessary
>
>
> The display-plugin-updates goal will check all the plugins and reporters
> used in your project and display a list of those plugins with newer versions
> available.
>
> Here are some examples of what this looks like:
>
> svn checkout 
> http://svn.codehaus.org/mojo/trunk/mojo/build-helper-maven-plugin 
> build-helper-maven-plugin
> cd build-helper-maven-plugin
>
> mvn versions:display-plugin-updates
>
>  Which produced the following output:
>
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Building Build Helper Maven Plugin
> [INFO]    task-segment: [versions:display-plugin-updates]
> [INFO] 
> ------------------------------------------------------------------------
>
> [INFO] [versions:display-plugin-updates]
> [INFO]
> [INFO] The following plugin updates are available:
> [INFO]   maven-checkstyle-plugin .................................. 2.1 -> 2.2
> [INFO]   maven-plugin-plugin .................................. 2.4.1 -> 2.4.2
>
> [INFO]   maven-pmd-plugin ......................................... 2.3 -> 2.4
> [INFO]   maven-project-info-reports-plugin ...................... 2.0.1 -> 2.1
> [INFO]   maven-surefire-report-plugin ......................... 2.4.2 -> 2.4.3
>
> [INFO]
> [INFO] All plugins have a version specified.
> [INFO]
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] BUILD SUCCESSFUL
> [INFO] 
> ------------------------------------------------------------------------
>
> [INFO] Total time: 1 second
> [INFO] Finished at: Fri Aug 15 09:45:42 IST 2008
> [INFO] Final Memory: 9M/167M
> [INFO] 
> ------------------------------------------------------------------------
>
>  The plugin will also warn if you have not specified the versions of any
> plugins that you are using and tell you what version you are currently
> using. Best practice in Maven is to always specify the plugin versions in
> order to ensure that builds are reproducable.
>
> svn checkout http://svn.codehaus.org/mojo/tags/xmlbeans-maven-plugin-2.3.1 
> xmlbeans-maven-plugin
> cd xmlbeans-maven-plugin
>
> mvn versions:display-plugin-updates
>
>  Which produced the following output:
>
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Building Maven XML Beans Plugin
> [INFO]    task-segment: [versions:display-plugin-updates]
> [INFO] 
> ------------------------------------------------------------------------
>
> [INFO] [versions:display-plugin-updates]
> [INFO]
> [INFO] All plugins are using the latest versions.
> [INFO]
> [WARNING] The following plugins do not have their version specified:
> [WARNING]   maven-checkstyle-plugin ...................................... 2.2
>
> [WARNING]   maven-javadoc-plugin ......................................... 2.4
> [WARNING]   maven-jxr-plugin ............................................. 2.1
> [WARNING]   maven-plugin-plugin ........................................ 2.4.2
>
> [WARNING]   maven-pmd-plugin ............................................. 2.4
> [WARNING]   maven-surefire-report-plugin ............................... 2.4.3
> [WARNING]   org.codehaus.mojo:taglist-maven-plugin ....................... 2.2
>
> [INFO]
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] BUILD SUCCESSFUL
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Total time: 1 second
>
> [INFO] Finished at: Fri Aug 15 09:34:03 IST 2008
> [INFO] Final Memory: 9M/167M
> [INFO] 
> ------------------------------------------------------------------------
>
>
>
> On Fri, Aug 15, 2008 at 9:50 AM, Mark Hobson <[EMAIL PROTECTED]> wrote:
>
>> It'd also be handy to have goals that display/update dependency versions
>> too.
>>
>> Mark
>>
>> 2008/8/14 Stephen Connolly <[EMAIL PROTECTED]>:
>> > I was thinking of a display-plugin-updates and a update-plugins monos
>> >
>> > Sent from my iPod
>> >
>> > On 14 Aug 2008, at 18:44, Dennis Lundberg <[EMAIL PROTECTED]> wrote:
>> >
>> >> When I find the time for it I'll write down a proposal.
>> >>
>> >> I'm also keep to investigate how my ideas correlates with Stephen's
>> >> plugin. It might be another mojo in that plugin.
>> >>
>> >> Dan Tran wrote:
>> >>>
>> >>> can you deploy a snaphot for review? :-)
>> >>>
>> >>> On Thu, Aug 14, 2008 at 10:21 AM, Dennis Lundberg <[EMAIL PROTECTED]
>> >
>> >>> wrote:
>> >>>>
>> >>>> Not yet, but I have one in my head...
>> >>>>
>> >>>> Jason Dillon wrote:
>> >>>>>
>> >>>>> Is there any nice plugin which I can run which will look at the
>> current
>> >>>>> project and tell me which plugins are out of date?
>> >>>>>
>> >>>>> --jason
>> >>>>>
>> >>>>>
>> ---------------------------------------------------------------------
>> >>>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >>>>> For additional commands, e-mail: [EMAIL PROTECTED]
>> >>>>>
>> >>>>>
>> >>>>
>> >>>> --
>> >>>> Dennis Lundberg
>> >>>>
>> >>>> ---------------------------------------------------------------------
>> >>>> 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]
>> >>>
>> >>>
>> >>
>> >>
>> >> --
>> >> Dennis Lundberg
>> >>
>> >> ---------------------------------------------------------------------
>> >> 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