On Oct 16, 2010, at 8:00 PM, <[email protected]> wrote:

> Thank you Vincent.  This is what I thought, but just wanted to confirm. IMHO, 
> having your local dependencies change out from under you is counter-intuitive 
> especially when you're building that component locally. So setting the 
> snapshot dependency to "never" seems like it would produce a more intuitive 
> behavior.

Yes, we realize this was a mistake and we will change the default behaviour in 
Maven to make the user always force an update. Just one of those things where 
we thought we would help people see failures earlier but it's really it's one 
of those "Oh, that wasn't such a good idea."

It should never update automatically, which you can manually configure now, and 
if developers want to update they can. Or if you want your CI system to eagerly 
consume snapshots then just configure Maven to always update.

> But as you point out, if at some point in the future I decided to remove the 
> local source for componentA (and therefore stop building it), I'd have to 
> know to either blow away my local repo or use -U. What I'd really like is a 
> behavior that says: "If I'm not building a dependent component locally, 
> always download snapshots.  Otherwise, never download snapshots.  But I 
> understand that this would be difficult to achieve.
> 
> -b
> 
> ________________________________________
> From: ext Vincent Latombe [[email protected]]
> Sent: Saturday, October 16, 2010 6:59 PM
> To: Maven Users List
> Subject: Re: Questions on SNAPSHOTs
> 
> Hello Brian
> 
> What you assume is right : if the timestamp of a remote artifact is more
> recent than the timestamp of a local artifact (under .m2), it will download
> the version from the remote repository. This will be happening depending on
> the updatePolicy (daily by default), or if you add -U flag to the command
> line.
> 
> If you want to be sure that your local changes are picked up every time and
> not overriden by a remote snapshot, you have 2 options :
> - recompile your local changes to component A at least once a day (with
> default value of updatePolicy which is daily)
> - set updatePolicy to "never". In this case, Maven will download remote
> snapshots artifacts only if you don't already have them locally.
> 
> The drawback of the second option is that you'll need to use -U each time
> you want new remote snapshots, but at least you won't be surprised.
> 
> Hope it answer your interrogations,
> 
> Cheers,
> 
> Vincent
> 
> 2010/10/16 <[email protected]>
> 
>> My apologies for my previous post.  That's what I get for trying to save a
>> step by replying to someone else's post, but forgetting to change the
>> subject :-[
>> 
>> Hi all,
>> 
>> I could use some clarification on how SNAPSHOTs work.
>> 
>> Scenario:
>> 
>> - Maven 2.2.1
>> - componentB depends on componentA, both are being built as snapshot
>> versions.
>> - I have the source code for both components locally and have built and
>> installed both to my local repo (mvn install)
>> - Both components are also built on a CI server and the snapshot artifacts
>> are deployed to our in-house Artifactory repo.
>> Builds occur automatically whenever a change is detected by our CI server.
>> 
>> Questions:
>> 
>> Let's say I'm working on componentB. When building componentB, in what
>> cases will componentA be downloaded from Artifactory?
>> That is, what controls whether I am building componentB against the version
>> of componentA that I built and installed in my local repo
>> or against a newly-downloaded version that had been deployed to
>> Artifactory?
>> 
>> How is all of this affected by the snapshots updatePolicy in my settings?
>> By default, does a new version of componentA get downloaded
>> every day (assuming a new one has been deployed to Artifactory)?
>> 
>> Thanks.
>> 
>> -brian
>> 
>> 
>> ---------------------------------------------------------------------
>> 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]
>> 
>> 
> 
> 
> --
> Vincent
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 

Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder,  Apache Maven
http://twitter.com/jvanzyl
---------------------------------------------------------

What matters is not ideas, but the people who have them. Good people can fix 
bad ideas, but good ideas can't save bad people. 

 -- Paul Graham



Reply via email to