Re: A Maven extension for dependency tracking

2022-05-27 Thread Tamás Cservenák
Howdy, inline, also PR updated, simplified, and added a "demo" listener
that does exactly what you wanted.

On Fri, May 27, 2022 at 8:24 AM Grzegorz Grzybek 
wrote:

> Hello and thank you very much for your time ;)
>
> This looks exactly how I imagined it ;) - that the path is reachable via
> the RequestTrace!
> Doing everything in the RepositoryListener (correct me if I'm wrong, but
> artifactResolved() is called both after remote access and when the artifact
> is found in local repo?) looks very clean, because it's natural to register
> such listeners - much more natural than extending some crucial classes from
> the resolver.
>
>
Yes, now you can do everything as a listener. There is a "demo" added that
does exactly what you want.
Still, the warning stands: listener "steals" time from collection,
collecting is "hot", so be quick! :)
But now we are thread-safe as well, so "parallel pom" download will work as
well.
(there is one thing I need to fix: for this safety I need to COPY the path
list, as once multithreaded, that list will change!!!)


>
> I remember you mentioned this "end graph", but I didn't find a place (hook,
> listener) where I can get it - could you please point me to the class?
>

I was talking about another extension point to be added, which is not there.
But now I am unsure if it is needed or not...


>
> I think artifactResolved() callback was called not only for POMs... and all
> the changes made to the collector were supposed to prepare the dependency
> path, so I didn't see a problem here. But you're the expert ;)


Yes, event is called a bit more: for every artifact being resolved, that
means that is called
for POMs (when artifactDescriptorRequest is run in collector), but that one
request may trigger SEVERAL
events, like for the POM, then for it's parent POM, then for parent parent
POM etc. This is model builder, that
is building the effective POM for a given artifact, and in case it has a
parent POM, hence it needs to be resolved
as well.

Hence, there is that little "trick" in place that ensures that tree is
written only once, see the demo listener.
It could be improved even more (like in the case of mvnd, where you may
have several ongoing sessions at once).

HTH
Tamas


Re: A Maven extension for dependency tracking

2022-05-27 Thread Grzegorz Grzybek
Hello and thank you very much for your time ;)


wt., 24 maj 2022 o 15:54 Tamás Cservenák  napisał(a):

> Howdy,
>
> take a look at this:
> https://github.com/apache/maven-resolver/pull/182
> (demos are "mutilated" just to run them and observe output, changes there
> are unrelated)
>

This looks exactly how I imagined it ;) - that the path is reachable via
the RequestTrace!
Doing everything in the RepositoryListener (correct me if I'm wrong, but
artifactResolved() is called both after remote access and when the artifact
is found in local repo?) looks very clean, because it's natural to register
such listeners - much more natural than extending some crucial classes from
the resolver.


>
> But still, I am on edge: I still don't see why all this is "better", then
> just observe the collection end graph (having all, and then just write out
> reverse dep trees then?)
>

I remember you mentioned this "end graph", but I didn't find a place (hook,
listener) where I can get it - could you please point me to the class?


>
> Also, this is an "early" phase, the collection, hence only POMs are being
> downloaded. And the fact POM is downloaded (collected), does NOT mean JAR
> will be downloaded (resolved) as well
>

I think artifactResolved() callback was called not only for POMs... and all
the changes made to the collector were supposed to prepare the dependency
path, so I didn't see a problem here. But you're the expert ;)

kind regards
Grzegorz Grzybek


>
>
> Thanks
> T
>
> On Tue, May 24, 2022 at 12:40 PM Grzegorz Grzybek 
> wrote:
>
> > wt., 24 maj 2022 o 11:17 Tamás Cservenák 
> napisał(a):
> >
> > > Howdy,
> > >
> > > inline only the "interesting" part:
> > >
> > > So, after playing a bit with 1.8.0[.1] of the BF/DF resolvers and your
> > #176
> > > > PR, I see that example
> > > >
> > > >
> > >
> >
> org.eclipse.aether.internal.impl.collect.DependencyCollectorDelegate#dependencyCollected()
> > > > extension point you've introduced is a bit too early for my use
> case...
> > > > It's invoked during dependency collection, but I think it'd be better
> > to
> > > > simply use "full path" when there's actual download (or resolution
> from
> > > > local repository).
> > > >
> > >
> > > This part I don't quite get: "too early"? What do you mean here?
> > > As events you use are fired "even before" as I see...
> > >
> >
> > By "too early" I mean that your dependencyCollected() was already
> printing
> > the path, while in my case I was only pushing current dependency on top
> of
> > the stack and full stack was available later in an implementation of
> > org.eclipse.aether.AbstractRepositoryListener
> >
> > However I didn't check if that's simply not the same - I thought that I
> > could have several stack pushed before my implementation of
> > org.eclipse.aether.AbstractRepositoryListener#artifactDownloaded() was
> > called - but I may be wrong.
> >
> >
> > >
> > >
> > > >
> > > > My whole need to extend resolver was to collect the path from initial
> > to
> > > > final dependency, so the stack is available when it's needed.
> > > >
> > >
> > > Isn't the PR doing that? Or did I miss something?
> > >
> >
> > as above - I was only thinking that there's a difference between these
> two:
> >  - your PR calls dependencyCollected() just after
> node.getChildren().add()
> > (DF) or context.getParent().getChildren().add() (BF) and prints the
> > reversed dependency path
> >  - my extension pushes the dependency (DF only in resolver 1.6.3) and
> > prints the path in org.eclipse.aether.RepositoryListener
> >
> > if these are effectively the same, sorry for confusion ;)
> >
> >
> > >
> > >
> > > >
> > > > Initially I thought that org.eclipse.aether.RequestTrace should be
> the
> > > > thing I could use to get current dependency path, but I found it's
> not
> > > > possible.
> > > >
> > >
> > > Yes, my hopes were geared toward RequestTrace as well, as it could
> > > represent a tree just fine, but
> > >
> > >
> > > >
> > > > Maybe your DependencyCollectorDelegate#dependencyCollected() could
> > simply
> > > > "expose" the List path somewhere? Maybe in Maven
> > session?
> > > > as attribute?
> > > >
> > >
> > > In a moment parallel collection comes into picture (
> > > https://github.com/apache/maven-resolver/pull/178)
> > > this will be not enough, as there is one session but multiple threads
> are
> > > working on it. Hence,
> > > I agree that "hooking" onto existing events would be the best, but,
> sadly
> > > they are quite disconnected
> > > from collectors, hence, it is hard to "couple" them in the right
> > manner
> > >
> > > Cleanest would be if the event would carry its own copy of path
> > >
> >
> > Yeah... org.eclipse.aether.RepositoryEvent is very "public", so finding a
> > path there would be great. However² I print most of the tracking
> > information not in org.eclipse.aether.RepositoryListener but in overriden
> > org.eclipse.aether.repository.LocalRepositoryManager#find() (because I
> > wanted 

Re: [VOTE] Release Maven SCM version 1.13.0

2022-05-27 Thread Tamás Cservenák
+1

On Thu, May 26, 2022 at 12:44 PM Michael Osipov  wrote:

> Hi,
>
> We solved 7 issues:
>
> https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12317828=12331357
>
> There are still a couple of issues left in JIRA:
> https://issues.apache.org/jira/projects/SCM/issues
>
> Staging repo:
> https://repository.apache.org/content/repositories/maven-1754/
>
> https://repository.apache.org/content/repositories/maven-1754/org/apache/maven/scm/maven-scm/1.13.0/maven-scm-1.13.0-source-release.zip
>
> Source release checksum(s):
> maven-scm-1.13.0-source-release.zip
> sha512:
>
> 2a9622eeafd3ebacb7becd26fbc82485e9c1baa7eb8a6e0a09c8b7e166b8efc39f9d72fdac7ffd0b545cdb0d1cc454d3f76bbe37034af2b7e85e8d200634041c
>
> Staging site:
> https://maven.apache.org/scm-archives/scm-LATEST/
>
> Guide to testing staged releases:
> https://maven.apache.org/guides/development/guide-testing-releases.html
>
> Vote open for 72 hours.
>
> [ ] +1
> [ ] +0
> [ ] -1
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
> For additional commands, e-mail: dev-h...@maven.apache.org
>
>


Re: [VOTE] Release Maven SCM version 1.13.0

2022-05-27 Thread Hervé BOUTEMY
I just updated the live site:
https://maven.apache.org/scm-archives/scm-LATEST/

Le vendredi 27 mai 2022, 00:58:02 CEST Michael Osipov a écrit :
> Am 2022-05-27 um 00:49 schrieb Olivier Lamy:
> > not changing my vote but the web site is still using google-analytics.
> > 
> >   google-analytics
> 
> True, this release did not receive Maven Parent 36 because the
> depencencies cannot be upgraded. I expect this to be the last release of
> the 1.x line. 2.x is already away from GA.
> 
> M
> 
> -
> To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
> For additional commands, e-mail: dev-h...@maven.apache.org





-
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org