You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by youhaodeyi <yo...@gmail.com> on 2009/03/10 07:37:26 UTC

How can I force maven download dependency?

Maven will not download dependency from remote repository if the dependency
already exists. How can I force Maven download the dependency even if the
dependency exists?
-- 
View this message in context: http://www.nabble.com/How-can-I-force-maven-download-dependency--tp22428816p22428816.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: How can I force maven download dependency?

Posted by Blake Martin <bl...@gmail.com>.
I can definitely confirm that deploy overwrites the previous deployment; it
never "ignores" the new version. However, as Stephen mentioned above, if you
deploy twice and you have the artifact from the first deployment in your
local repository, you'll have to delete it in order to get the new version.

In my company's setup, only Continuum is authorized to build a non-SNAPSHOT
version, and even then only when doing a release (using the release plugin).
This way, we can never release an artifact with the same version twice. We
enforce this using a simple antrun execution that checks whether the version
is a SNAPSHOT or not (in our "standards" POM, which everything inherits
from). You can't so much as build a non-SNAPSHOT version locally in our
setup. It's a very nice setup and it doesn't hold us back in any way.

On Tue, Mar 10, 2009 at 10:24 AM, Sahoo <Sa...@sun.com> wrote:

> If it silently ignores, then it is too bad. Let's hope someone can confirm
> the behavior.
>
>
> Stephen Connolly wrote:
>
>> AFAIK, it silently ignores the second deploy in newer versions of the
>> maven-deploy-plugin but I could be wrong
>>
>> 2009/3/10 Sahoo <Sa...@sun.com>
>>
>>
>>
>>> Although this is a core assumption in maven, many people don't know this.
>>> The question that I have is why does maven not try to protect itself from
>>> human error? Should mvn-deploy not refuse to overwrite an artifact by
>>> default?
>>>
>>> Sahoo
>>>
>>>
>>> Stephen Connolly wrote:
>>>
>>>
>>>
>>>> The core assumption of a maven repository is that once a non-SNAPSHOT
>>>> version is available, that artifact will *NEVER* change.
>>>>
>>>> Thus once maven downloads log4j:log4j:1.2.13 it will *NEVER* look for it
>>>> again.
>>>>
>>>> This is why you should always keep your pom on a -SNAPSHOT version, as
>>>> the
>>>> only thing that Maven will look for newer versions of are -SNAPSHOT
>>>> versions.
>>>>
>>>> Now it sounds like you've been bold and have been deploying different
>>>> versions of an artifact with the same version number... the solution for
>>>> you
>>>> is to delete the artifact you don't want from your repository and then
>>>> maven
>>>> will be forced to download it again (as it no longer has a copy)
>>>>
>>>> Yes this is a pain to do this by hand... consider it a penance for
>>>> deploying
>>>> different versions of the same artifact with the same version number ;-)
>>>>
>>>> -Stephen
>>>>
>>>> 2009/3/10 youhaodeyi <yo...@gmail.com>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>> Maven will not download dependency from remote repository if the
>>>>> dependency
>>>>> already exists. How can I force Maven download the dependency even if
>>>>> the
>>>>> dependency exists?
>>>>> --
>>>>> View this message in context:
>>>>>
>>>>>
>>>>> http://www.nabble.com/How-can-I-force-maven-download-dependency--tp22428816p22428816.html
>>>>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> 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
>>>
>>>
>>>
>>>
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: How can I force maven download dependency?

Posted by Sahoo <Sa...@sun.com>.
If it silently ignores, then it is too bad. Let's hope someone can 
confirm the behavior.

Stephen Connolly wrote:
> AFAIK, it silently ignores the second deploy in newer versions of the
> maven-deploy-plugin but I could be wrong
>
> 2009/3/10 Sahoo <Sa...@sun.com>
>
>   
>> Although this is a core assumption in maven, many people don't know this.
>> The question that I have is why does maven not try to protect itself from
>> human error? Should mvn-deploy not refuse to overwrite an artifact by
>> default?
>>
>> Sahoo
>>
>>
>> Stephen Connolly wrote:
>>
>>     
>>> The core assumption of a maven repository is that once a non-SNAPSHOT
>>> version is available, that artifact will *NEVER* change.
>>>
>>> Thus once maven downloads log4j:log4j:1.2.13 it will *NEVER* look for it
>>> again.
>>>
>>> This is why you should always keep your pom on a -SNAPSHOT version, as the
>>> only thing that Maven will look for newer versions of are -SNAPSHOT
>>> versions.
>>>
>>> Now it sounds like you've been bold and have been deploying different
>>> versions of an artifact with the same version number... the solution for
>>> you
>>> is to delete the artifact you don't want from your repository and then
>>> maven
>>> will be forced to download it again (as it no longer has a copy)
>>>
>>> Yes this is a pain to do this by hand... consider it a penance for
>>> deploying
>>> different versions of the same artifact with the same version number ;-)
>>>
>>> -Stephen
>>>
>>> 2009/3/10 youhaodeyi <yo...@gmail.com>
>>>
>>>
>>>
>>>       
>>>> Maven will not download dependency from remote repository if the
>>>> dependency
>>>> already exists. How can I force Maven download the dependency even if the
>>>> dependency exists?
>>>> --
>>>> View this message in context:
>>>>
>>>> http://www.nabble.com/How-can-I-force-maven-download-dependency--tp22428816p22428816.html
>>>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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
>>
>>
>>     
>
>   

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


RE: How can I force maven download dependency?

Posted by Todd Thiessen <th...@nortel.com>.
I don't think so. It will overwrite an already existing release if your
repo manager allows it.

---
Todd Thiessen
 

> -----Original Message-----
> From: Stephen Connolly [mailto:stephen.alan.connolly@gmail.com] 
> Sent: Tuesday, March 10, 2009 7:58 AM
> To: Maven Users List
> Subject: Re: How can I force maven download dependency?
> 
> AFAIK, it silently ignores the second deploy in newer 
> versions of the maven-deploy-plugin but I could be wrong
> 
> 2009/3/10 Sahoo <Sa...@sun.com>
> 
> > Although this is a core assumption in maven, many people 
> don't know this.
> > The question that I have is why does maven not try to 
> protect itself 
> > from human error? Should mvn-deploy not refuse to overwrite an 
> > artifact by default?
> >
> > Sahoo
> >
> >
> > Stephen Connolly wrote:
> >
> >> The core assumption of a maven repository is that once a 
> non-SNAPSHOT 
> >> version is available, that artifact will *NEVER* change.
> >>
> >> Thus once maven downloads log4j:log4j:1.2.13 it will 
> *NEVER* look for 
> >> it again.
> >>
> >> This is why you should always keep your pom on a -SNAPSHOT 
> version, 
> >> as the only thing that Maven will look for newer versions of are 
> >> -SNAPSHOT versions.
> >>
> >> Now it sounds like you've been bold and have been 
> deploying different 
> >> versions of an artifact with the same version number... 
> the solution 
> >> for you is to delete the artifact you don't want from your 
> repository 
> >> and then maven will be forced to download it again (as it 
> no longer 
> >> has a copy)
> >>
> >> Yes this is a pain to do this by hand... consider it a penance for 
> >> deploying different versions of the same artifact with the same 
> >> version number ;-)
> >>
> >> -Stephen
> >>
> >> 2009/3/10 youhaodeyi <yo...@gmail.com>
> >>
> >>
> >>
> >>> Maven will not download dependency from remote repository if the 
> >>> dependency already exists. How can I force Maven download the 
> >>> dependency even if the dependency exists?
> >>> --
> >>> View this message in context:
> >>>
> >>> 
> http://www.nabble.com/How-can-I-force-maven-download-dependency--tp2
> >>> 2428816p22428816.html Sent from the Maven - Users mailing list 
> >>> archive at Nabble.com.
> >>>
> >>>
> >>> 
> --------------------------------------------------------------------
> >>> - 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
> >
> >
> 

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


Re: How can I force maven download dependency?

Posted by Stephen Connolly <st...@gmail.com>.
AFAIK, it silently ignores the second deploy in newer versions of the
maven-deploy-plugin but I could be wrong

2009/3/10 Sahoo <Sa...@sun.com>

> Although this is a core assumption in maven, many people don't know this.
> The question that I have is why does maven not try to protect itself from
> human error? Should mvn-deploy not refuse to overwrite an artifact by
> default?
>
> Sahoo
>
>
> Stephen Connolly wrote:
>
>> The core assumption of a maven repository is that once a non-SNAPSHOT
>> version is available, that artifact will *NEVER* change.
>>
>> Thus once maven downloads log4j:log4j:1.2.13 it will *NEVER* look for it
>> again.
>>
>> This is why you should always keep your pom on a -SNAPSHOT version, as the
>> only thing that Maven will look for newer versions of are -SNAPSHOT
>> versions.
>>
>> Now it sounds like you've been bold and have been deploying different
>> versions of an artifact with the same version number... the solution for
>> you
>> is to delete the artifact you don't want from your repository and then
>> maven
>> will be forced to download it again (as it no longer has a copy)
>>
>> Yes this is a pain to do this by hand... consider it a penance for
>> deploying
>> different versions of the same artifact with the same version number ;-)
>>
>> -Stephen
>>
>> 2009/3/10 youhaodeyi <yo...@gmail.com>
>>
>>
>>
>>> Maven will not download dependency from remote repository if the
>>> dependency
>>> already exists. How can I force Maven download the dependency even if the
>>> dependency exists?
>>> --
>>> View this message in context:
>>>
>>> http://www.nabble.com/How-can-I-force-maven-download-dependency--tp22428816p22428816.html
>>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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: How can I force maven download dependency?

Posted by Wendy Smoak <ws...@gmail.com>.
On Tue, Mar 10, 2009 at 3:20 AM, Sahoo <Sa...@sun.com> wrote:

> Although this is a core assumption in maven, many people don't know this.
> The question that I have is why does maven not try to protect itself from
> human error? Should mvn-deploy not refuse to overwrite an artifact by
> default?

You might want to follow/vote for (or patch!) issue MDEPLOY-74 -- Add
an option to be able to abort if an artifact is already present in the
deployment repository.

http://jira.codehaus.org/browse/MDEPLOY-74

-- 
Wendy

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


Re: How can I force maven download dependency?

Posted by Sahoo <Sa...@Sun.COM>.
Although this is a core assumption in maven, many people don't know 
this. The question that I have is why does maven not try to protect 
itself from human error? Should mvn-deploy not refuse to overwrite an 
artifact by default?

Sahoo

Stephen Connolly wrote:
> The core assumption of a maven repository is that once a non-SNAPSHOT
> version is available, that artifact will *NEVER* change.
>
> Thus once maven downloads log4j:log4j:1.2.13 it will *NEVER* look for it
> again.
>
> This is why you should always keep your pom on a -SNAPSHOT version, as the
> only thing that Maven will look for newer versions of are -SNAPSHOT
> versions.
>
> Now it sounds like you've been bold and have been deploying different
> versions of an artifact with the same version number... the solution for you
> is to delete the artifact you don't want from your repository and then maven
> will be forced to download it again (as it no longer has a copy)
>
> Yes this is a pain to do this by hand... consider it a penance for deploying
> different versions of the same artifact with the same version number ;-)
>
> -Stephen
>
> 2009/3/10 youhaodeyi <yo...@gmail.com>
>
>   
>> Maven will not download dependency from remote repository if the dependency
>> already exists. How can I force Maven download the dependency even if the
>> dependency exists?
>> --
>> View this message in context:
>> http://www.nabble.com/How-can-I-force-maven-download-dependency--tp22428816p22428816.html
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> 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: How can I force maven download dependency?

Posted by Stephen Connolly <st...@gmail.com>.
The core assumption of a maven repository is that once a non-SNAPSHOT
version is available, that artifact will *NEVER* change.

Thus once maven downloads log4j:log4j:1.2.13 it will *NEVER* look for it
again.

This is why you should always keep your pom on a -SNAPSHOT version, as the
only thing that Maven will look for newer versions of are -SNAPSHOT
versions.

Now it sounds like you've been bold and have been deploying different
versions of an artifact with the same version number... the solution for you
is to delete the artifact you don't want from your repository and then maven
will be forced to download it again (as it no longer has a copy)

Yes this is a pain to do this by hand... consider it a penance for deploying
different versions of the same artifact with the same version number ;-)

-Stephen

2009/3/10 youhaodeyi <yo...@gmail.com>

>
> Maven will not download dependency from remote repository if the dependency
> already exists. How can I force Maven download the dependency even if the
> dependency exists?
> --
> View this message in context:
> http://www.nabble.com/How-can-I-force-maven-download-dependency--tp22428816p22428816.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>