Christian Clausen wrote:
Hi,This is not the case with snapshot jars - they are always downloaded again if you are online.
I have noticed the following behaviour concerning maven dependencies:
[...] The first time a goal of a project depending on D is attained, the artifact is downloaded to the local repository. Suppose now that a new version of D is deployed to the remote repository, [...] the new version of D
is NOT installed in the local repository. Consequently, we are still using the old version of D.
The point of version numbers is to make a build repeatable. If people use a /real/ version number, then replace the artifact, they are shooting themselves in the foot - builds are no longer repeatable. The point of SNAPSHOTS is to be able to ask for something where the name stays the same but you are willing to sacrifice repeatability - ie during development of related projects.
...during development in a largerTry building, and depending on, artifact-x.y-SNAPSHOT.jar. (ie version x.y-SNAPSHOT instead of x.y.z) This should work exactly as you want, in recent b8 builds. This even allows you to build multiple 'working versions' of a project, eg tomcat-3.3-SNAPSHOT.jar, tomcat-4.1-SNAPSHOT.jar can coexist.
project consisting of several maven projects, I think it is good to be able to share "newest deployed versions" without having to be explicit about the "z" in x.y.z.
I can see one circumstance where having an unique name instead of SNAPSHOT for non-release builds is useful - thats when you're doing nightly builds, or otherwise timestamping jars, and you want to keep (eg) the last 5 nights builds around (note that keeping builds with unique names is for repeatability again). In this case, why not copy the nightly to the SNAPSHOT name in a postGoal? That way you have a SNAPSHOT thats consistent with the nightly, but you can keep using the same name if you don't care.
The SNAPSHOT convention neatly avoids having to decide what the 'latest' version of an artifact is (eg I have tomcat 3.2 - is tomcat 3.3 or tomcat 4.1 the latest? Answering 4.1 might break your code, and timestamps won't help you), and avoids attempting to do wildcards over the repository-protocol-of-the-day (eg tomcat-3.* - which still leaves you having to make decisions on the meaning of version numbers.)
Cheers,
-Baz
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
