[
https://issues.apache.org/jira/browse/MNG-7630?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17678843#comment-17678843
]
ASF GitHub Bot commented on MNG-7630:
-------------------------------------
rmannibucau commented on code in PR #913:
URL: https://github.com/apache/maven/pull/913#discussion_r1081652684
##########
maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/MavenWorkspaceReader.java:
##########
@@ -28,4 +29,20 @@
public interface MavenWorkspaceReader extends WorkspaceReader {
Model findModel(Artifact artifact);
+
+ /**
+ * List all available artifacts this workspace repository manages.
+ *
+ * @return a stream of artifacts in no particular order
+ * @since 3.9.0
+ */
+ Stream<Artifact> listArtifacts();
Review Comment:
> Caching is not a concern of the API.
iterating and reitarating over the map on big project will be a topic IMHO
if these methods are useful.
> If I need to browse them twice (why?) I can again make a collection,
`I` is you in this PR? if so I agree, if the caller then no cause you can
get multiple callers and would mean your API is not relevant.
> there are literally no code except the I/O cases where it is recommended
huh, no. But anyway you can't assume the related API has no IO related.
> This is obviously not a decisions point, because then most of the time no
one would ever use streams as most of them "fit in memory".
Which is what is in most real not overkill/hype API ;).
> while a collection approach would require
this part is wrong, what you propose is to visit the whole stream and mutate
it whereas you can push back the filters and things like that in the actual
materialization stream (the impl) which is what is done at maven in general
(think scope filter for ex) and is more efficient on all the points you mention.
So ultimately, except the point we didn't understand each others, everything
converges to a collection it seems.
> Support listing of workspace models and implement upcomming interface methods
> -----------------------------------------------------------------------------
>
> Key: MNG-7630
> URL: https://issues.apache.org/jira/browse/MNG-7630
> Project: Maven
> Issue Type: Improvement
> Reporter: Christoph Läubrich
> Priority: Major
> Fix For: 3.9.0, 4.0.0-alpha-4, 4.0.0
>
>
> This is the Maven counterpart of MRESOLVER-307.
> As this will be most likely be released in resolver 2.0 only maven can still
> already have an implementation for the new methods to:
> - show how they would look like
> - if upgrading source is already prepared
> - Maven has an own extension of that interface that should have similar
> behaviour
--
This message was sent by Atlassian Jira
(v8.20.10#820010)