You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Francesco Mari <ma...@gmail.com> on 2012/08/20 15:46:18 UTC

Clean local repository

Hi,

I would like to launch a build using a clean local repository. I have
already tried the following solutions:

- Use the "maven.repo.local" property [1] from Maven 1. I haven't
found a similar reference in Maven 2 & 3 documentation, so I don't
know it's safe to use.

- Specify a <localRepository> in a custom settings.xml and specifiy it
on the command line using a "-s" option. This forces me to duplicate
the original settings.xml file only to use a different local repo.

- Use dependency:purge-local-repository to clean the local repository.
It works quite well, but it doesn't remove parent POMs that,
obviously, are not dependencies.

- Manually or automatically delete my current local repository. It's
not what I want.

I've also found a similar conversation on this mailing list [2] but it
seems that there were no definitive solutions.

Do you had the same problem in the past? Have you found other
solutions to this problem?

Thanks,

Francesco

[1]: http://maven.apache.org/maven-1.x/reference/properties.html
[2]: http://maven.40175.n5.nabble.com/Cleaning-local-repository-td114691.html

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


Re: Re: Clean local repository

Posted by Olivier Lamy <ol...@apache.org>.
2012/8/21 Francesco Mari <ma...@gmail.com>:
> The point is that I haven't found any reference to "maven.repo.local"
> in Maven 2 & 3 documentation, so I am not sure if its use is safe.
Ok.
But IMHO it's really safe we (maven dev) use that for building stuff
with a clean repo (see how maven core is build with ant bootstrap)
>
> 2012/8/21 Olivier Lamy <ol...@apache.org>:
>> 2012/8/21 Francesco Mari <ma...@gmail.com>:
>>> I would like to run a build using an empty local repo to verify that all artifacts are correctly deployed to the remote one. This includes not only dependencies, but parent POMs too.
>>>
>>> I want to do this from time to time, and I don't want to delete the local repo I use for all my other builds. This is why I was looking for a way to specify a different repo from command line (or other similar ways).
>>
>> -Dmaven.repo.local=/path/to/repo is your friend.
>>
>>>
>>> -----Original Message-----
>>> From: Barrie Treloar <ba...@gmail.com>
>>> Date: Tue, 21 Aug 2012 09:18:17
>>> To: Maven Users List<us...@maven.apache.org>
>>> Reply-To: "Maven Users List" <us...@maven.apache.org>
>>> Subject: Re: Clean local repository
>>>
>>> On Mon, Aug 20, 2012 at 11:16 PM, Francesco Mari
>>> <ma...@gmail.com> wrote:
>>>> Hi,
>>>>
>>>> I would like to launch a build using a clean local repository. I have
>>>> already tried the following solutions:
>>>
>>> Why?
>>> What are you hoping to achieve?
>>>
>>> The easiest is to delete your ~/.m2/repository directory, but you
>>> discount that option.
>>>
>>> ---------------------------------------------------------------------
>>> 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
>>
>>
>>
>> --
>> Olivier Lamy
>> Talend: http://coders.talend.com
>> http://twitter.com/olamy | http://linkedin.com/in/olamy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>



-- 
Olivier Lamy
Talend: http://coders.talend.com
http://twitter.com/olamy | http://linkedin.com/in/olamy

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


Re: Re: Clean local repository

Posted by Francesco Mari <ma...@gmail.com>.
The point is that I haven't found any reference to "maven.repo.local"
in Maven 2 & 3 documentation, so I am not sure if its use is safe.

2012/8/21 Olivier Lamy <ol...@apache.org>:
> 2012/8/21 Francesco Mari <ma...@gmail.com>:
>> I would like to run a build using an empty local repo to verify that all artifacts are correctly deployed to the remote one. This includes not only dependencies, but parent POMs too.
>>
>> I want to do this from time to time, and I don't want to delete the local repo I use for all my other builds. This is why I was looking for a way to specify a different repo from command line (or other similar ways).
>
> -Dmaven.repo.local=/path/to/repo is your friend.
>
>>
>> -----Original Message-----
>> From: Barrie Treloar <ba...@gmail.com>
>> Date: Tue, 21 Aug 2012 09:18:17
>> To: Maven Users List<us...@maven.apache.org>
>> Reply-To: "Maven Users List" <us...@maven.apache.org>
>> Subject: Re: Clean local repository
>>
>> On Mon, Aug 20, 2012 at 11:16 PM, Francesco Mari
>> <ma...@gmail.com> wrote:
>>> Hi,
>>>
>>> I would like to launch a build using a clean local repository. I have
>>> already tried the following solutions:
>>
>> Why?
>> What are you hoping to achieve?
>>
>> The easiest is to delete your ~/.m2/repository directory, but you
>> discount that option.
>>
>> ---------------------------------------------------------------------
>> 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
>
>
>
> --
> Olivier Lamy
> Talend: http://coders.talend.com
> http://twitter.com/olamy | http://linkedin.com/in/olamy

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


Re: Re: Clean local repository

Posted by Olivier Lamy <ol...@apache.org>.
2012/8/21 Francesco Mari <ma...@gmail.com>:
> I would like to run a build using an empty local repo to verify that all artifacts are correctly deployed to the remote one. This includes not only dependencies, but parent POMs too.
>
> I want to do this from time to time, and I don't want to delete the local repo I use for all my other builds. This is why I was looking for a way to specify a different repo from command line (or other similar ways).

-Dmaven.repo.local=/path/to/repo is your friend.

>
> -----Original Message-----
> From: Barrie Treloar <ba...@gmail.com>
> Date: Tue, 21 Aug 2012 09:18:17
> To: Maven Users List<us...@maven.apache.org>
> Reply-To: "Maven Users List" <us...@maven.apache.org>
> Subject: Re: Clean local repository
>
> On Mon, Aug 20, 2012 at 11:16 PM, Francesco Mari
> <ma...@gmail.com> wrote:
>> Hi,
>>
>> I would like to launch a build using a clean local repository. I have
>> already tried the following solutions:
>
> Why?
> What are you hoping to achieve?
>
> The easiest is to delete your ~/.m2/repository directory, but you
> discount that option.
>
> ---------------------------------------------------------------------
> 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



-- 
Olivier Lamy
Talend: http://coders.talend.com
http://twitter.com/olamy | http://linkedin.com/in/olamy

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


R: Re: Clean local repository

Posted by Francesco Mari <ma...@gmail.com>.
I would like to run a build using an empty local repo to verify that all artifacts are correctly deployed to the remote one. This includes not only dependencies, but parent POMs too.

I want to do this from time to time, and I don't want to delete the local repo I use for all my other builds. This is why I was looking for a way to specify a different repo from command line (or other similar ways).

-----Original Message-----
From: Barrie Treloar <ba...@gmail.com>
Date: Tue, 21 Aug 2012 09:18:17 
To: Maven Users List<us...@maven.apache.org>
Reply-To: "Maven Users List" <us...@maven.apache.org>
Subject: Re: Clean local repository

On Mon, Aug 20, 2012 at 11:16 PM, Francesco Mari
<ma...@gmail.com> wrote:
> Hi,
>
> I would like to launch a build using a clean local repository. I have
> already tried the following solutions:

Why?
What are you hoping to achieve?

The easiest is to delete your ~/.m2/repository directory, but you
discount that option.

---------------------------------------------------------------------
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: Clean local repository

Posted by Stephen Connolly <st...@gmail.com>.
mv ~/.m2/repository ~/.m2/repository.bak
mvn verify
rm -rvf ~/.m2/repository
mv ~/.m2/repository.bak ~/.m2/repository

That is the easiest with least risk of throwing away and custom deps that
you have installed locally and want to ensure they are deployed to your
repo manager

On Tuesday, 21 August 2012, Barrie Treloar wrote:

> On Mon, Aug 20, 2012 at 11:16 PM, Francesco Mari
> <mari.francesco@gmail.com <javascript:;>> wrote:
> > Hi,
> >
> > I would like to launch a build using a clean local repository. I have
> > already tried the following solutions:
>
> Why?
> What are you hoping to achieve?
>
> The easiest is to delete your ~/.m2/repository directory, but you
> discount that option.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org <javascript:;>
> For additional commands, e-mail: users-help@maven.apache.org<javascript:;>
>
>

Re: Clean local repository

Posted by Barrie Treloar <ba...@gmail.com>.
On Mon, Aug 20, 2012 at 11:16 PM, Francesco Mari
<ma...@gmail.com> wrote:
> Hi,
>
> I would like to launch a build using a clean local repository. I have
> already tried the following solutions:

Why?
What are you hoping to achieve?

The easiest is to delete your ~/.m2/repository directory, but you
discount that option.

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