You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Qureshi,Shahzad [Ontario]" <Sh...@ec.gc.ca> on 2009/12/14 21:39:16 UTC

To use version for maven.plugins or not to use, that is the question :)

Hi all,

I wanna know the standard and the reasons behind it.

I want to find out if I should specify a version for a maven plugins, lets say maven-javadoc-plugin, or not to specify it and in which case the default one will be used. At this point, I don't specify versions

I recently setup Nexus at my work and started seeing all these errors where Nexus wouldn't find snapshot version for plugins, maven-javadoc-plugin being one of them. The maven-javadoc-plugin is at 2.6.2-SNAPSHOT right now, but my settings.xml is not setup to take care of this scenario.

It seems that I've to do what example 14.2 at this link: http://svn.sonatype.org/m2eclipse/trunk/org.maven.ide.eclipse.book/book/ch14s03.html says

And in which case I've to use -Ppublic-snapshots flag during my packaging. 

Now what is the general standard in a case like this? I can easily do what the link above suggests or just specify a version. I've reservations with both of them and see advantages for both of them as well.

What do the gurus suggest? :)

Thanks 



--------------------------------------------
Shahzad Qureshi
Systems Analyst/Programmer
Applications Directorate | La direction générale des applications
Chief Information Officer Branch | Direction générale du dirigeant principal de l'information
Environment Canada | Environnement Canada
shahzad.qureshi@ec.gc.ca
Telephone | Téléphone 416-739-4702
Government of Canada | Gouvernement du Canada
Website | Site Web www.ec.gc.ca


Re: To use version for maven.plugins or not to use, that is the question :)

Posted by Anders Hammar <an...@hammar.net>.
And Maven 3 will also complain (well, inform) about this.

/Anders

On Mon, Dec 14, 2009 at 22:09, Justin Edelson <ju...@gmail.com>wrote:

> Yes - use a version.
>
> Set up an organizational pom and use it as the parent for all of your
> projects. Use the pluginManagement section of the organizational pom to
> declare plugin versions.
>
> Unless you do this, your builds aren't fully reproduceable.
>
> Justin
>
> On Mon, Dec 14, 2009 at 3:39 PM, Qureshi,Shahzad [Ontario] <
> Shahzad.Qureshi@ec.gc.ca> wrote:
>
> > Hi all,
> >
> > I wanna know the standard and the reasons behind it.
> >
> > I want to find out if I should specify a version for a maven plugins,
> lets
> > say maven-javadoc-plugin, or not to specify it and in which case the
> default
> > one will be used. At this point, I don't specify versions
> >
> > I recently setup Nexus at my work and started seeing all these errors
> where
> > Nexus wouldn't find snapshot version for plugins, maven-javadoc-plugin
> being
> > one of them. The maven-javadoc-plugin is at 2.6.2-SNAPSHOT right now, but
> my
> > settings.xml is not setup to take care of this scenario.
> >
> > It seems that I've to do what example 14.2 at this link:
> >
> http://svn.sonatype.org/m2eclipse/trunk/org.maven.ide.eclipse.book/book/ch14s03.htmlsays
> >
> > And in which case I've to use -Ppublic-snapshots flag during my
> packaging.
> >
> > Now what is the general standard in a case like this? I can easily do
> what
> > the link above suggests or just specify a version. I've reservations with
> > both of them and see advantages for both of them as well.
> >
> > What do the gurus suggest? :)
> >
> > Thanks
> >
> >
> >
> > --------------------------------------------
> > Shahzad Qureshi
> > Systems Analyst/Programmer
> > Applications Directorate | La direction générale des applications
> > Chief Information Officer Branch | Direction générale du dirigeant
> > principal de l'information
> > Environment Canada | Environnement Canada
> > shahzad.qureshi@ec.gc.ca
> > Telephone | Téléphone 416-739-4702
> > Government of Canada | Gouvernement du Canada
> > Website | Site Web www.ec.gc.ca
> >
> >
>

Re: To use version for maven.plugins or not to use, that is the question :)

Posted by Justin Edelson <ju...@gmail.com>.
Yes - use a version.

Set up an organizational pom and use it as the parent for all of your
projects. Use the pluginManagement section of the organizational pom to
declare plugin versions.

Unless you do this, your builds aren't fully reproduceable.

Justin

On Mon, Dec 14, 2009 at 3:39 PM, Qureshi,Shahzad [Ontario] <
Shahzad.Qureshi@ec.gc.ca> wrote:

> Hi all,
>
> I wanna know the standard and the reasons behind it.
>
> I want to find out if I should specify a version for a maven plugins, lets
> say maven-javadoc-plugin, or not to specify it and in which case the default
> one will be used. At this point, I don't specify versions
>
> I recently setup Nexus at my work and started seeing all these errors where
> Nexus wouldn't find snapshot version for plugins, maven-javadoc-plugin being
> one of them. The maven-javadoc-plugin is at 2.6.2-SNAPSHOT right now, but my
> settings.xml is not setup to take care of this scenario.
>
> It seems that I've to do what example 14.2 at this link:
> http://svn.sonatype.org/m2eclipse/trunk/org.maven.ide.eclipse.book/book/ch14s03.htmlsays
>
> And in which case I've to use -Ppublic-snapshots flag during my packaging.
>
> Now what is the general standard in a case like this? I can easily do what
> the link above suggests or just specify a version. I've reservations with
> both of them and see advantages for both of them as well.
>
> What do the gurus suggest? :)
>
> Thanks
>
>
>
> --------------------------------------------
> Shahzad Qureshi
> Systems Analyst/Programmer
> Applications Directorate | La direction générale des applications
> Chief Information Officer Branch | Direction générale du dirigeant
> principal de l'information
> Environment Canada | Environnement Canada
> shahzad.qureshi@ec.gc.ca
> Telephone | Téléphone 416-739-4702
> Government of Canada | Gouvernement du Canada
> Website | Site Web www.ec.gc.ca
>
>

Re: To use version for maven.plugins or not to use, that is the question :)

Posted by Barrie Treloar <ba...@gmail.com>.
On Tue, Dec 15, 2009 at 7:09 AM, Qureshi,Shahzad [Ontario]
<Sh...@ec.gc.ca> wrote:
> Hi all,
>
> I wanna know the standard and the reasons behind it.
>
> I want to find out if I should specify a version for a maven plugins, lets say maven-javadoc-plugin, or not to specify it and in which case the default one will be used. At this point, I don't specify versions
>
> I recently setup Nexus at my work and started seeing all these errors where Nexus wouldn't find snapshot version for plugins, maven-javadoc-plugin being one of them. The maven-javadoc-plugin is at 2.6.2-SNAPSHOT right now, but my settings.xml is not setup to take care of this scenario.

In general, you NEVER want to work with snapshots.
You would only use a snapshot of a plugin if you wanted to test that a
critical bug has been fixed and then you would request that the plugin
get officially released (and if you can't wait for that, build an
internal release).

If you start including snapshots in your build process your build can
suddenly break and your build is not reproducible (since SNAPSHOTS by
definition change over time)

That said, as others have pointed out, the best pracitce is to create
an organizational parent pom and declare versions there and have your
project poms use this parent pom.
That way you have control over when to upgrade.

If you are lazy (we are) then you can leave off the version and use
whatever the latest released version gets pulled down and only if the
build breaks to set the version to one that works.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org