You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by Zoran Regvart <zo...@regvart.com> on 2017/02/22 20:53:59 UTC

Purging local repository in install phase

Hi Cameleers,
I think we all have this problem, you're building a module of Camel
using Maven and it grabs the latest snapshots from Maven Central, so
you end up with a number of -SNAPSHOT artifacts in your local Maven
repository.

I would like to add `build-helper:remove-project-artifact` to parent
POM to remove all artifact in install phase.

Does this make sense to you?

zoran
-- 
Zoran Regvart

Re: Purging local repository in install phase

Posted by Claus Ibsen <cl...@gmail.com>.
I have some scripts I can run from time to time to delete old and
snapshot stuff from local m2 repo

https://gist.github.com/davsclaus/25a01789bb4612af676da0895c6b18ab

https://gist.github.com/davsclaus/fa2e7c73a8a697c63dde63ca0d8be59a

On Thu, Feb 23, 2017 at 10:01 AM, Zoran Regvart <zo...@regvart.com> wrote:
> Hi Claus,
> tanks for the reply, this is exactly why I'm asking, I don't want to
> break anyone's workflow,
>
> On Thu, Feb 23, 2017 at 9:18 AM, Claus Ibsen <cl...@gmail.com> wrote:
>> I do like that I can branch to an older branch and just build a module
>> like camel-hazelcast and it downloads the other SNAPSHOTS from maven,
>> such as camel-core etc. Otherwise I would need to rebuild the entire
>> source tree.
>
> yes, you don't have to rebuild the dependant modules at the cost of
> disk space as each -SNAPSHOT is another artifact the local repository
> (after just few weeks, 1.1GB on my machine)
>
>> Isn't it possible to run some command from the command line using
>> maven to delete/clean your maven repo?
>
> sure, you can run `mvn build-helper:remove-project-artifact` from the
> source tree root (besides the obvious `rm -rf ...`
>
>> Or maybe have some maven profile so this is only run if you do -P
>> cleanrepo or something
>
> I think that would be the best approach, having it on by default could
> be to invasive, created CAMEL-10884[1]
>
> zoran
>
> [1] https://issues.apache.org/jira/browse/CAMEL-10884
> --
> Zoran Regvart



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Re: Purging local repository in install phase

Posted by Zoran Regvart <zo...@regvart.com>.
Hi Claus,
tanks for the reply, this is exactly why I'm asking, I don't want to
break anyone's workflow,

On Thu, Feb 23, 2017 at 9:18 AM, Claus Ibsen <cl...@gmail.com> wrote:
> I do like that I can branch to an older branch and just build a module
> like camel-hazelcast and it downloads the other SNAPSHOTS from maven,
> such as camel-core etc. Otherwise I would need to rebuild the entire
> source tree.

yes, you don't have to rebuild the dependant modules at the cost of
disk space as each -SNAPSHOT is another artifact the local repository
(after just few weeks, 1.1GB on my machine)

> Isn't it possible to run some command from the command line using
> maven to delete/clean your maven repo?

sure, you can run `mvn build-helper:remove-project-artifact` from the
source tree root (besides the obvious `rm -rf ...`

> Or maybe have some maven profile so this is only run if you do -P
> cleanrepo or something

I think that would be the best approach, having it on by default could
be to invasive, created CAMEL-10884[1]

zoran

[1] https://issues.apache.org/jira/browse/CAMEL-10884
-- 
Zoran Regvart

Re: Purging local repository in install phase

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

I do like that I can branch to an older branch and just build a module
like camel-hazelcast and it downloads the other SNAPSHOTS from maven,
such as camel-core etc. Otherwise I would need to rebuild the entire
source tree.

Isn't it possible to run some command from the command line using
maven to delete/clean your maven repo?
Or maybe have some maven profile so this is only run if you do -P
cleanrepo or something




On Wed, Feb 22, 2017 at 9:53 PM, Zoran Regvart <zo...@regvart.com> wrote:
> Hi Cameleers,
> I think we all have this problem, you're building a module of Camel
> using Maven and it grabs the latest snapshots from Maven Central, so
> you end up with a number of -SNAPSHOT artifacts in your local Maven
> repository.
>
> I would like to add `build-helper:remove-project-artifact` to parent
> POM to remove all artifact in install phase.
>
> Does this make sense to you?
>
> zoran
> --
> Zoran Regvart



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2