You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Br...@nokia.com on 2010/10/16 22:42:09 UTC

Questions on SNAPSHOTs

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: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


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


RE: Questions on SNAPSHOTs

Posted by Br...@nokia.com.
Right, it's more the coders that I'm concerned about.  So "never" seems like the best solution.  I guess "never" actually means "once" if you never had the artifact locally. It seems like the dependency rules might benefit from some knowledge of whether the artifact in the local repository was the result of building the source locally and installing vs downloading from a remote repo. Although an attempt to build in this kind of logic might end up being more confusing than helpful.

Thanks for your response.

-brian

________________________________________
From: ext Jason van Zyl [jason@sonatype.com]
Sent: Saturday, October 16, 2010 8:10 PM
To: Maven Users List
Subject: Re: Questions on SNAPSHOTs

On Oct 16, 2010, at 8:00 PM, <Br...@nokia.com> 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 [vincent.latombe@gmail.com]
> 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 <Br...@nokia.com>
>
>> 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: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>
>
> --
> Vincent
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

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




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


Re: Questions on SNAPSHOTs

Posted by Jason van Zyl <ja...@sonatype.com>.
On Oct 16, 2010, at 8:00 PM, <Br...@nokia.com> 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 [vincent.latombe@gmail.com]
> 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 <Br...@nokia.com>
> 
>> 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: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>> 
>> 
> 
> 
> --
> Vincent
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 

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




RE: Questions on SNAPSHOTs

Posted by Br...@nokia.com.
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. 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 [vincent.latombe@gmail.com]
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 <Br...@nokia.com>

> 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: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


--
Vincent

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


Re: Questions on SNAPSHOTs

Posted by Vincent Latombe <vi...@gmail.com>.
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 <Br...@nokia.com>

> 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: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Vincent

RE: Questions on SNAPSHOTs

Posted by Br...@nokia.com.
I know what it's called. It was a mistake.  I apologized.  That's about the best I can do.  I hope the list will forgive me and the next response will attempt to answer my questions.

-b

________________________________________
From: ext Brian Topping [topping@codehaus.org]
Sent: Saturday, October 16, 2010 5:01 PM
To: Maven Users List
Subject: Re: Questions on SNAPSHOTs

On Oct 16, 2010, at 4:42 PM, <Br...@nokia.com> wrote:

> That's what I get for trying to save a step by replying to someone else's post, but forgetting to change the subject :-[

That's called "thread hijacking", and the problem with it is that the mail you create will show up in everyone's inbox and every list archiver as a part of the thread that you hit "Reply" to and change the subject.  It's a much bigger problem than you realized!

The cause of this is an SMTP header called "In-Reply-To".  Most mail readers will allow you to "Show All Headers" so you can see it for yourself.  If you don't remove that header before sending your new inquiry, you'll inadvertently join hijackers everywhere!

Practically, it takes just as much time to remove that header as it does to create a new email to the list.  That's why most people do it (and keeping the mail list archives clean in the process).

Please, don't hit "Reply" to start a new thread!

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


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


Re: Questions on SNAPSHOTs

Posted by Brian Topping <to...@codehaus.org>.
On Oct 16, 2010, at 4:42 PM, <Br...@nokia.com> wrote:

> That's what I get for trying to save a step by replying to someone else's post, but forgetting to change the subject :-[

That's called "thread hijacking", and the problem with it is that the mail you create will show up in everyone's inbox and every list archiver as a part of the thread that you hit "Reply" to and change the subject.  It's a much bigger problem than you realized!

The cause of this is an SMTP header called "In-Reply-To".  Most mail readers will allow you to "Show All Headers" so you can see it for yourself.  If you don't remove that header before sending your new inquiry, you'll inadvertently join hijackers everywhere!

Practically, it takes just as much time to remove that header as it does to create a new email to the list.  That's why most people do it (and keeping the mail list archives clean in the process).

Please, don't hit "Reply" to start a new thread!  

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