Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #39305

Re: maven and its downloads

From Andreas Leitgeb <avl@logic.at>
Newsgroups comp.lang.java.programmer
Subject Re: maven and its downloads
Date 2020-02-26 16:57 +0000
Organization A noiseless patient Spider
Message-ID <slrnr5d8rp.p7n.avl@logic.at> (permalink)
References <slrnr5cdr0.897.avl@logic.at> <3b5cef64-f28b-447c-a6cc-5b47dfe463ee@googlegroups.com>

Show all headers | View raw


Eric Douglas <e.d.programmer@gmail.com> wrote:
> On Wednesday, February 26, 2020 at 4:16:26 AM UTC-5, Andreas Leitgeb wrote:
>> I've got a single maven project on a particular user at a machine.
>> After some development stages (with often changed dependencies),
>> I made a full clean+build (took only a few minutes), then used
>>    "find ~/.m2/repository -amin +60 -exec rm {} +"
>> (remove everything not used in the last 60 minutes)
>> On next build afterwards, it again downloaded a few packages.
>> 
>> Apparently, it downloads packages that it doesn't ever use.
>> Majority of them is in org.apache.maven group.
>> 
>> Given that the local repo of that user is used only for that
>> project, is there a way to prune it of no-longer necessary
>> stuff, while avoiding to prune stuff that will be re-downloaded?
> It should download everything in your pom file(s).
> Are you seeing projects downloaded which are not referenced for download anywhere?

Yes.  Well, not "anywhere in my pom-files".

> Define "doesn't ever use".
> Are you thinking it doesn't use things it downloaded because you didn't
> call them directly?

As I wrote:  The OS doesn't record any attempt at reading those files
during the time I do a complete build.

> Sometimes your dependencies have dependencies,
> and sometimes they're only required if you call certain methods.
> You might reference a project which pulls down POI because it can
> read/write a spreadsheet, but it won't care if you're missing that
> (runtime) dependency if you never do that in your application.

I did the same methods before the "find" and afterwards.

Apparently, maven sometimes just checks if a file exists in the repo,
and if not then downloads it, despite not accessing it during a build.

Usually it does seem to get the files only on demand, as I could see
when I first did a "mvn clean" and it downloaded some "clean"-helpers.

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

maven and its downloads Andreas Leitgeb <avl@logic.at> - 2020-02-26 09:16 +0000
  Re: maven and its downloads Eric Douglas <e.d.programmer@gmail.com> - 2020-02-26 07:51 -0800
    Re: maven and its downloads Andreas Leitgeb <avl@logic.at> - 2020-02-26 16:57 +0000
      Re: maven and its downloads Joerg Meier <joergmmeier@arcor.de> - 2020-02-27 09:35 +0100
        Re: maven and its downloads Andreas Leitgeb <avl@logic.at> - 2020-02-27 11:30 +0000
          Re: maven and its downloads Andreas Leitgeb <avl@logic.at> - 2020-02-27 11:59 +0000
            Re: maven and its downloads Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2020-02-27 18:59 +0100
          Re: maven and its downloads Eric Douglas <e.d.programmer@gmail.com> - 2020-02-27 05:50 -0800

csiph-web