You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Xavier Hanin <xa...@gmail.com> on 2007/05/12 12:59:07 UTC

understanding SNAPSHOT versions

Hi,

I would like to have a clean understanding of how SNAPSHOT versions work,
could someone point me to corresponding documentation?

More precisely, I would like to understand when a SNAPSHOT version is
published in a repository with a timestamp, when is it published as is, and
how the dependency resolution works exactly - which versions match when I
depend on 1.0-SNAPSHOT, and which one takes precedence in case there are
several one.

Thanks in advance for your help!

Xavier

-- 
Xavier Hanin - Independent Java Consultant
Manage your dependencies with Ivy!
http://incubator.apache.org/ivy/

Re: understanding SNAPSHOT versions

Posted by Wendy Smoak <ws...@gmail.com>.
On 5/12/07, DavidWilliams@sungardebs.com <Da...@sungardebs.com> wrote:

> I have one question here.  If you are not using snapshot versions, will
> Maven check for updates of regular versions?

You should always specify a version number, and released artifacts
should never change, so there's usually no reason to check for
updates.

That said, the current behavior for plugins is as follows:  if you do
not specify a <version>, Maven will use the latest version from your
local repository.  If the plugin is not in your local repository,
Maven will grab the latest release from a remote repository.  It will
not automatically update plugin versions after that, but -cpu on the
command line will force updates.

This behavior is considered dangerous and is likely to change in 2.1
-- see http://www.nabble.com/-IMPORTANT--Maven-2-Plugin-Auto-Versioning-Considered-Dangerous-t3560426.html
and always specify a version number for plugins.

Version ranges might be another exception here, but I don't use them.

-- 
Wendy

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


Re: understanding SNAPSHOT versions

Posted by Da...@SunGardEBS.com.
Wendy,

I have one question here.  If you are not using snapshot versions, will 
Maven check for updates of regular versions?

Thanks,

David Williams
Software Configuration Engineer
205-271-6159



"Wendy Smoak" <ws...@gmail.com> 
05/12/2007 12:46 PM
Please respond to
"Maven Users List" <us...@maven.apache.org>


To
"Maven Users List" <us...@maven.apache.org>
cc

Subject
Re: understanding SNAPSHOT versions






On 5/12/07, Xavier Hanin <xa...@gmail.com> wrote:

> Thanks, it's much clearer now!

One more thing that affects snapshots is the update policy.  By
default, it's daily.  In your local repository, Maven keeps track of
when it last checked each repository for a particular artifact.  You
can use -U on the command line to force updates.

-- 
Wendy

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


_____________________________________
CONFIDENTIALITY:  This email (including any attachments) may contain 
confidential, proprietary and privileged information, and unauthorized 
disclosure or use is prohibited.  If you received this email in error, 
please notify the sender and delete this email from your system.  Thank 
you.

Re: understanding SNAPSHOT versions

Posted by Wendy Smoak <ws...@gmail.com>.
On 5/12/07, Xavier Hanin <xa...@gmail.com> wrote:

> Thanks, it's much clearer now!

One more thing that affects snapshots is the update policy.  By
default, it's daily.  In your local repository, Maven keeps track of
when it last checked each repository for a particular artifact.  You
can use -U on the command line to force updates.

-- 
Wendy

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


Re: understanding SNAPSHOT versions

Posted by Xavier Hanin <xa...@gmail.com>.
On 5/12/07, Wendy Smoak <ws...@gmail.com> wrote:
>
> On 5/12/07, Xavier Hanin <xa...@gmail.com> wrote:
>
> > I would like to have a clean understanding of how SNAPSHOT versions
> work,
> > could someone point me to corresponding documentation?
> >
> > More precisely, I would like to understand when a SNAPSHOT version is
> > published in a repository with a timestamp, when is it published as is,
>
> This is controlled by the <uniqueVersion> element on the repositories
> listed in distribution management.
>
>
> http://maven.apache.org/ref/2.0.4/maven-model/maven.html#class_snapshotRepository
>
> > and
> > how the dependency resolution works exactly - which versions match when
> I
> > depend on 1.0-SNAPSHOT, and which one takes precedence in case there are
> > several one.
>
> Maven reads the maven-metadata.xml file found in the repository and
> takes the version listed there.  Compare the metadata files for these
> two snapshots:
>
>
> http://people.apache.org/repo/m2-snapshot-repository/org/apache/tiles/tiles-core/2.0.2-SNAPSHOT/
>
>
> http://people.apache.org/repo/m2-snapshot-repository/org/apache/struts/struts2-core/2.1.0-SNAPSHOT/
>
> Tiles is publishing timestamped snapshots, and Struts is not.


Thanks, it's much clearer now!

Xavier

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


-- 
Xavier Hanin - Independent Java Consultant
Manage your dependencies with Ivy!
http://incubator.apache.org/ivy/

Re: understanding SNAPSHOT versions

Posted by Wendy Smoak <ws...@gmail.com>.
On 5/12/07, Xavier Hanin <xa...@gmail.com> wrote:

> I would like to have a clean understanding of how SNAPSHOT versions work,
> could someone point me to corresponding documentation?
>
> More precisely, I would like to understand when a SNAPSHOT version is
> published in a repository with a timestamp, when is it published as is,

This is controlled by the <uniqueVersion> element on the repositories
listed in distribution management.

http://maven.apache.org/ref/2.0.4/maven-model/maven.html#class_snapshotRepository

> and
> how the dependency resolution works exactly - which versions match when I
> depend on 1.0-SNAPSHOT, and which one takes precedence in case there are
> several one.

Maven reads the maven-metadata.xml file found in the repository and
takes the version listed there.  Compare the metadata files for these
two snapshots:

http://people.apache.org/repo/m2-snapshot-repository/org/apache/tiles/tiles-core/2.0.2-SNAPSHOT/

http://people.apache.org/repo/m2-snapshot-repository/org/apache/struts/struts2-core/2.1.0-SNAPSHOT/

Tiles is publishing timestamped snapshots, and Struts is not.

-- 
Wendy

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